Skip to content
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

fix(nuxt): session cookie max age #1576

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 packages/nuxt/src/runtime/auth/api.session-verification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default defineEventHandler(async (event) => {
setResponseStatus(event, 301)
} else {
const cookie = await adminAuth
.createSessionCookie(token!, { expiresIn: AUTH_COOKIE_MAX_AGE })
.createSessionCookie(token!, { expiresIn: AUTH_COOKIE_MAX_AGE * 1_000 })
.catch((e: any) => {
logger.error('Error minting the cookie', e)
})
Expand Down Expand Up @@ -73,7 +73,7 @@ export default defineEventHandler(async (event) => {

// these must be within this file because the handler gets inlined in dev mode
const ID_TOKEN_MAX_AGE = 5 * 60
const AUTH_COOKIE_MAX_AGE = 60 * 60 * 24 * 5 * 1_000
const AUTH_COOKIE_MAX_AGE = 60 * 60 * 24 * 5
// MUST be named session to be kept
// https://firebase.google.com/docs/hosting/manage-cache#using_cookies
const AUTH_COOKIE_NAME = '__session'