diff --git a/apps/cm/src/entities/auth/api/auth-service.ts b/apps/cm/src/entities/auth/api/auth-service.ts index a8fa70622..ddb3dffac 100644 --- a/apps/cm/src/entities/auth/api/auth-service.ts +++ b/apps/cm/src/entities/auth/api/auth-service.ts @@ -12,11 +12,11 @@ import { import { clearRefreshTimer, - removeToken, setToken, setupRefreshTimer, tokenManager, } from "../lib/token-manager"; +import { clearDeviceId } from "../lib/device-id"; function resolveLoginError(message: string | undefined): string { switch (message) { @@ -102,8 +102,7 @@ async function silentRefresh(): Promise { async function logout(): Promise { tokenManager.clearAuthToken(); - removeToken("site-id-key"); - removeToken("site-theme-key"); + clearDeviceId(); if (typeof window !== "undefined") { window.dispatchEvent(new CustomEvent("auth:logout")); diff --git a/apps/cs/src/entities/auth/api/auth-service.ts b/apps/cs/src/entities/auth/api/auth-service.ts index a8312e46c..cf7281ff9 100644 --- a/apps/cs/src/entities/auth/api/auth-service.ts +++ b/apps/cs/src/entities/auth/api/auth-service.ts @@ -13,7 +13,6 @@ import { import { clearDeviceId, getOrCreateDeviceId } from "../lib/device-id"; import { clearRefreshTimer, - removeToken, setToken, setupRefreshTimer, tokenManager, @@ -115,8 +114,6 @@ async function silentRefresh(): Promise { async function logout(): Promise { tokenManager.clearAuthToken(); clearDeviceId(); - removeToken("site-id-key"); - removeToken("site-theme-key"); if (typeof window !== "undefined") { window.dispatchEvent(new CustomEvent("auth:logout")); diff --git a/apps/st/src/entities/auth/api/auth-service.ts b/apps/st/src/entities/auth/api/auth-service.ts index 0c51d6dc3..198e69c81 100644 --- a/apps/st/src/entities/auth/api/auth-service.ts +++ b/apps/st/src/entities/auth/api/auth-service.ts @@ -102,6 +102,7 @@ async function silentRefresh(): Promise { export async function logout(): Promise { tokenManager.clearAuthToken(); clearDeviceId(); + if (typeof window !== "undefined") { window.dispatchEvent(new CustomEvent("auth:logout")); }