fix: Unable to access document without reload after 24h+ session

This commit is contained in:
Tom Moor
2023-08-05 08:24:37 -04:00
parent 042ea7b61f
commit 5a60329021
3 changed files with 6 additions and 11 deletions

View File

@@ -5,7 +5,6 @@ import { getCookie, setCookie, removeCookie } from "tiny-cookie";
import { CustomTheme, TeamPreferences, UserPreferences } from "@shared/types";
import Storage from "@shared/utils/Storage";
import { getCookieDomain, parseDomain } from "@shared/utils/domains";
import { Hour } from "@shared/utils/time";
import RootStore from "~/stores/RootStore";
import Policy from "~/models/Policy";
import Team from "~/models/Team";
@@ -106,9 +105,6 @@ export default class AuthStore {
this.rehydrate(data);
void this.fetch();
// Refresh the auth store every 12 hours that the window is open
setInterval(this.fetch, 12 * Hour);
// persists this entire store to localstorage whenever any keys are changed
autorun(() => {
Storage.set(AUTH_STORE, this.asJson);
@@ -238,7 +234,10 @@ export default class AuthStore {
if (err.error === "user_suspended") {
this.isSuspended = true;
this.suspendedContactEmail = err.data.adminEmail;
return;
}
throw err;
} finally {
this.isFetching = false;
}