Is there a way to automatically log out a user from Nuxt-Auth when one of the APIs returns an Unauthorized 401 response? I am using AXIOS and the built-in functions of Nuxt-Auth for making requests.
Here are my nuxt-config settings for nuxt-auth:
auth: {
redirect: {
login: '/login',
logout: '/',
callback: '/login',
home: '/panel/dashboard'
},
strategies: {
local: {
token: {
property: 'token',
global: true,
type: 'Bearer',
required: true,
},
user: {
property: 'user',
autoFetch: true
},
endpoints: {
login: {url: '/api/auth/login_verify', method: 'post'},
logout: {url: '/api/auth/logout', method: 'get'},
user: {url: '/api/auth/validate', method: 'get'},
},
},
}
},