Skip to content

Commit c3f4bc4

Browse files
authored
Fix #1756 (#1786)
1 parent 30b93bb commit c3f4bc4

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

docs/openapi-fetch/middleware-auth.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ If authorization isn’t needed for certain routes, you could also handle that w
160160
const UNPROTECTED_ROUTES = ["/v1/login", "/v1/logout", "/v1/public/"];
161161

162162
const authMiddleware = {
163-
onRequest({ url, request }) {
164-
if (UNPROTECTED_ROUTES.some((pathname) => url.startsWith(pathname))) {
163+
onRequest({ schemaPath, request }) {
164+
if (UNPROTECTED_ROUTES.some((pathname) => schemaPath.startsWith(pathname))) {
165165
return undefined; // don’t modify request for certain paths
166166
}
167167

packages/openapi-fetch/src/index.d.ts

-2
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,6 @@ export type MergedOptions<T = unknown> = {
125125
};
126126

127127
export interface MiddlewareCallbackParams {
128-
/** Final URL for this request */
129-
readonly url: string;
130128
/** Current Request object */
131129
request: Request;
132130
/** The original OpenAPI schema path (including curly braces) */

0 commit comments

Comments
 (0)