Closed leszekkrol closed 2 months ago
Could you try to update the duration to be a week?
export default defineNuxtConfig({
modules: ['nuxt-auth-utils'],
runtimeConfig: {
session: {
maxAge: 60 * 60 * 24 * 7 // 1 week
}
}
})
@atinux Yeah, I tried that, I have the exact same setup as you.
Could you try to update the duration to be a week?
export default defineNuxtConfig({ modules: ['nuxt-auth-utils'], runtimeConfig: { session: { maxAge: 60 * 60 * 24 * 7 // 1 week } } })
I can confirm that setting the maxAge of the session cookie fixes the Safari-Issue.
Can you confirm that it fixes it @leszekkrol ?
Have the same issue. I set the max age session:
// #https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: {
enabled: false,
},
runtimeConfig: {
public: {
baseUrl: process.env.LARAVEL_BACKEND_URL,
},
baseUrl: process.env.LARAVEL_BACKEND_URL,
clientId: process.env.LARAVEL_CLIENT_ID,
clientSecret: process.env.LARAVEL_CLIENT_SECRET,
session: {
maxAge: 60 * 60 * 24 * 7, // 1 week
},
},
css: ['~/assets/css/main.css'],
modules: ['@nuxtjs/tailwindcss', 'nuxt-auth-utils'],
typescript: {
shim: false,
tsConfig: {
include: ['~/types/*.ts'],
},
},
})
But I can not get back anything after I set the the session data and I can not see anything under the cookies tab.
await setUserSession(event, {
user: {
name: 'John Doe',
},
})
On Chrome it works fine and I see the Nuxt-session.
Could this be related to https://github.com/atinux/nuxt-auth-utils/issues/78? Safari doesn't persist secure cookies on localhost if you are not using https.
Yea it works now with https. Thanks,
I’m using the following code to handle OAuth login via X with auth-utils. The session is successfully set and persists on Firefox and Chrome, but it doesn’t persist on Safari.
Steps to Reproduce:
Expected Behavior:
The session should persist across all browsers.
Actual Behavior:
The session does not persist on Safari.
Environment:
Additional Information:
This issue seems to be isolated to Safari. Any insights or fixes would be greatly appreciated!