sidebase / nuxt-auth

Authentication built for Nuxt 3! Easily add authentication via OAuth providers, credentials or Email Magic URLs!
https://auth.sidebase.io
MIT License
1.25k stars 162 forks source link

enableOnWindowFocus is not working with local provider! #850

Closed S1ipKn0T closed 1 month ago

S1ipKn0T commented 1 month ago

Environment

Reproduction

My nuxt.config.js file:

auth: {
        baseURL: 'http://localhost:8000/api/v1/auth',
        provider: {
            type: 'local',
            endpoints: {
                signIn: {path: '/login', method: 'post'},
                signOut: {path: '/logout', method: 'post'},
                signUp: {path: '/register', method: 'post'},
                getSession: {path: '/session', method: 'get'},
            },
            token: {
                signInResponseTokenPointer: '/token',
                type: 'Bearer',
                cookieName: 'auth.token',
                headerName: 'Authorization',
                maxAgeInSeconds: 7200,
                sameSiteAttribute: 'lax',
                cookieDomain: 'http://localhost:3000'
            },
            pages: {
                login: '/login'
            },
        },
        sessionRefresh: {
            enableOnWindowFocus: false,
        }
    },

Describe the bug

when I set the enableOnWindowFocus to false I`m still getting the session refresh request when I switch between browser tabs!

Additional context

No response

Logs

No response