The site uses the standard nuxt authorization with the use of cookies and localstorage.
When logging in, the user has the "Remember me" checkbox, respectively, if it is disabled, it is expected to log out of the account at the end of the browser session.
The default cookie timeout is session, but using localstorage to store auth tokens at the same time leaves the user logged in.
/config/auth.js
export default {
watchLoggedIn: true,
strategies: {
local: false,
customStrategy: {
_scheme: '~/schemes/customScheme',
endpoints: {
login: {
url: '/v2/dashboard/auth/login',
method: 'post',
},
logout: false,
cookie: {
prefix: '',
},
token: {
prefix: '',
},
localStorage: {
prefix: '',
},
},
tokenName: 'sp-api-key',
tokenRequired: true,
globalToken: true,
tokenType: '',
},
Is there a way to set the length of storage of authorization tokens in local storage for a time equal to the browser session? Or delete authorization tokens from localStorage after the end of the browser session?