Fix logout loop
This commit is contained in:
@ -58,7 +58,9 @@ class AuthStore {
|
||||
|
||||
Cookie.remove('accessToken', { path: '/' });
|
||||
await localForage.clear();
|
||||
window.location.href = BASE_URL;
|
||||
|
||||
// add a timestamp to force reload from server
|
||||
window.location.href = `${BASE_URL}?done=${new Date().getTime()}`;
|
||||
};
|
||||
|
||||
@action
|
||||
@ -127,6 +129,8 @@ class AuthStore {
|
||||
// sessions created pre-google auth
|
||||
this.token = Cookie.get('accessToken') || data.token;
|
||||
|
||||
if (this.token) setImmediate(() => this.fetch());
|
||||
|
||||
autorun(() => {
|
||||
try {
|
||||
localStorage.setItem(AUTH_STORE, this.asJson);
|
||||
|
Reference in New Issue
Block a user