File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,15 @@ export default {
1919 console .error (error)
2020 if (error .response .status === 401 || error .response .status === 419 ) {
2121 if (error .response .data .message === ' CSRF token mismatch.' ) return
22+
23+ if (error .response .status === 401 && error .config .url === ' /logout' ) {
24+ router .replace ({ name: ' Login' })
25+ return
26+ }
27+
2228 this .logout ()
2329 .catch ((error ) => { console .error (error) })
30+
2431 router .replace ({ name: ' Login' })
2532 } else if (error .response .status === 403 ) {
2633 router .push ({ name: ' VerifyEmail' })
Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ export const useAuthStore = defineStore('auth', {
2828 console . error ( error )
2929 throw error
3030 } )
31+ . finally ( ( ) => {
32+ this . $reset ( )
33+ } )
3134 } ,
3235 } ,
3336 getters : {
You can’t perform that action at this time.
0 commit comments