fix: correct Logto session cookie prefix in middleware
Cookie is named `logto_<appId>` not `logto:<appId>`. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
8462aa9ef4
commit
6328a8d0d3
1 changed files with 2 additions and 2 deletions
|
|
@ -10,9 +10,9 @@ export function middleware(request: NextRequest) {
|
|||
}
|
||||
|
||||
// Protected routes: check for Logto session cookie
|
||||
// The Logto SDK stores session data in a cookie named `logto:<appId>`
|
||||
// The Logto SDK stores session data in a cookie named `logto_<appId>`
|
||||
const hasSession = request.cookies.getAll().some(
|
||||
(cookie) => cookie.name.startsWith('logto:')
|
||||
(cookie) => cookie.name.startsWith('logto_')
|
||||
);
|
||||
|
||||
if (!hasSession && !pathname.startsWith('/auth')) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue