inject defaults + cleanup

This commit is contained in:
Hayden 2022-09-03 22:19:13 -08:00
parent 9b46ea7874
commit 5f589f95b8
8 changed files with 212 additions and 85 deletions

View file

@ -33,5 +33,14 @@ export const useAuthStore = defineStore('auth', {
return result;
},
/**
* clearSession is used when the user cannot be logged out via the API and
* must clear it's local session, usually when a 401 is received.
*/
clearSession() {
this.token = '';
this.expires = '';
navigateTo('/');
},
},
});