I'm creating an app using nuxt (2.15.8) and i'm using the @nuxtjs/auth (4.9.1) for authentication. I use local strategy to login users
auth: {
redirect: {
login: '/login',
logout: false,
home: false
},
strategies: {
local: {
endpoints: {
login: {
url: 'api/login',
method: 'post',
propertyName: 'token'
},
user: {
url: 'api/user/fetch-logged-in',
method: 'get',
propertyName: false
}
},
tokenType: ''
}
}
}
While working locally, the users can login/logout without any problems. Once you log in, you can refresh the page and you stay logged-in which is exactly what I want.
The problem occurs on the staging server. I can login without any problems, but as soon as i refresh the page, I am automatically logged out and brought to the login page.
What's also strange is that when that happens, the auth._token.local in the cookies and the local storage is not empty, I can still see the token but i have to login again.