Skip to content

Commit 479b2db

Browse files
committed
fix(auth): disable basic token query bypass
Comment out the basic-auth middleware shortcut that allowed any request with a token query parameter to skip the session-cookie check. This keeps unauthenticated direct page loads on the normal login redirect path unless a valid session cookie exists.
1 parent 6cd8e8f commit 479b2db

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

middleware.basic.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ export default function basicMiddleware(request: NextRequest) {
1818
return NextResponse.next();
1919
}
2020

21-
const token = request.nextUrl.searchParams.get("token");
22-
if (token) {
23-
return NextResponse.next();
24-
}
21+
// FIXME: Comment it out. Not sure what this for.
22+
// const token = request.nextUrl.searchParams.get("token");
23+
// if (token) {
24+
// return NextResponse.next();
25+
// }
2526

2627
const hasSession =
2728
request.cookies.has("ory_kratos_session") ||

0 commit comments

Comments
 (0)