Skip to content

Fix #1756 #1786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/openapi-fetch/middleware-auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ If authorization isn’t needed for certain routes, you could also handle that w
const UNPROTECTED_ROUTES = ["/v1/login", "/v1/logout", "/v1/public/"];

const authMiddleware = {
onRequest({ url, request }) {
if (UNPROTECTED_ROUTES.some((pathname) => url.startsWith(pathname))) {
onRequest({ schemaPath, request }) {
if (UNPROTECTED_ROUTES.some((pathname) => schemaPath.startsWith(pathname))) {
return undefined; // don’t modify request for certain paths
}

Expand Down
2 changes: 0 additions & 2 deletions packages/openapi-fetch/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ export type MergedOptions<T = unknown> = {
};

export interface MiddlewareCallbackParams {
/** Final URL for this request */
readonly url: string;
/** Current Request object */
request: Request;
/** The original OpenAPI schema path (including curly braces) */
Expand Down