0.2.94
This commit is contained in:
1 parent
f508b7c882
commit
25d04daaee
12 files changed
+323
-90
No files matched your search
+10
-1
@@ -93,6 +93,11 @@ export async function setAuthSession(session) {
|
||||
await setLanguage(session?.language || "en", { scope: "account" });
|
||||
window.dispatchEvent(new CustomEvent("rustpad:session-change", { detail: { session } }));
|
||||
}
|
||||
export async function expireAuthSession() {
|
||||
if (!getAuthToken()) return;
|
||||
await clearAuthSession();
|
||||
window.dispatchEvent(new CustomEvent("rustpad:session-expired"));
|
||||
}
|
||||
export async function clearAuthSession() {
|
||||
localStorage.removeItem(AUTH_STATE_KEY);
|
||||
localStorage.removeItem("rustpad:auth-token");
|
||||
@@ -101,6 +106,10 @@ export async function clearAuthSession() {
|
||||
sessionStorage.removeItem(NICKNAME_KEY);
|
||||
setNicknameCookie("");
|
||||
restoreGuestTheme();
|
||||
await restoreGuestLanguage();
|
||||
try {
|
||||
await restoreGuestLanguage();
|
||||
} catch {
|
||||
// A language bundle failure must not block logout or session-expiry events.
|
||||
}
|
||||
window.dispatchEvent(new CustomEvent("rustpad:session-change", { detail: { session: null } }));
|
||||
}
|
||||
Reference in new issue
Block a user