nuxt-community / auth-module

Zero-boilerplate authentication support for Nuxt 2
https://auth.nuxtjs.org
MIT License
1.93k stars 924 forks source link

Auth reset on IOS when close safari and reopen #1816

Open starofsky opened 1 year ago

starofsky commented 1 year ago

Hi, I have a problem in IOS: after logged in, I close safari, wait a few minutes and reopen safari. The cookies and localStorage will be reset to false. I used Nuxt-auth revision: "@nuxtjs/auth-next": "5.0.0-1607534757.1122b76" and Keycloak with config:

auth: {
        localStorage: {
            prefix: ''
        },
        cookie: {
            prefix: ''
        },
        strategies: {
            local: false,
            keycloak: {
                scheme: '~/plugins/keycloak.js',
                endpoints: {
                    authorization: ``,
                    token: ``,
                    userInfo: ``,
                    logout: ``,
                    login: ``,
                    register: ``
                },
                token: {
                    property: 'access_token',
                    type: 'Bearer',
                    name: 'Authorization',
                    maxAge: 300
                },
                refreshToken: {
                    property: 'refresh_token',
                    maxAge: 60 * 60 * 24 * 30
                },
                responseType: 'code',
                grantType: 'authorization_code',
                clientId: ,
                scope: ['openid', 'profile', 'email'],
                codeChallengeMethod: 'S256'
            }
        },
        redirect: {
            login: '/login',
            callback: '/callback',
            logout: false,
            home: '/logging-in'
        }
    }

Do you have any suggestion? Thank you so much!