-
-
Notifications
You must be signed in to change notification settings - Fork 188
Open
Labels
Description
Environment
- Operating System:
Windows_NT - Node Version:
v22.14.0 - Nuxt Version:
3.18.1 - CLI Version:
3.28.0 - Nitro Version:
2.11.8 - Package Manager:
[email protected] - Builder:
- - User Config:
compatibilityDate,devtools,modules,plugins,css,ssr,typescript,fontawesome,svgo,i18n,spaLoadingTemplate,auth,pwa,vite,postcss,runtimeConfig,sentry,sourcemap - Runtime Modules:
@nuxtjs/[email protected],@sidebase/[email protected],@vueuse/[email protected],@nuxtjs/[email protected],[email protected],@vite-pwa/[email protected],@vesp/[email protected],@sentry/nuxt/[email protected],@nuxt/[email protected] - Build Modules:
-
Reproduction
/
Describe the bug
I have the following config in my nuxt.config.ts :
auth: {
baseURL: process.env.API_AUTH_URL,
globalAppMiddleware: {
isEnabled: true,
},
provider: {
type: "local",
endpoints: {
signIn: { path: "/api/login", method: "post" },
signOut: { path: "/api/logout", method: "post" },
getSession: { path: "/api/user", method: "get" },
},
token: {
signInResponseTokenPointer: "/token",
maxAgeInSeconds: Number(process.env.MAX_AGE_TOKEN),
cookieName: "auth.token",
},
session: {
dataResponsePointer: "/data",
},
refresh: {
isEnabled: true,
endpoint: {
path: "/api/refresh",
method: "post",
},
refreshOnlyToken: false,
token: {
signInResponseRefreshTokenPointer: "/refresh_token",
maxAgeInSeconds: Number(process.env.MAX_AGE_REFRESH_TOKEN),
cookieName: "auth.refresh-token",
},
},
},
}
In my backend, the token returned on the login call is a JWT token including an array of rights belonging to the user.
If this token is too long, it won't be saved in a cookie and the user will have to login at every refresh of the page.
The token I tried to use was 4609 characters long, I managed to reduce its size but I think it should be noted in the documentation that there are some size limits about the cookie size (or a console error when setting the cookie).
Additional context
No response