diff --git a/src/lib/online/mock-service.ts b/src/lib/online/mock-service.ts index c9d60c3..faad015 100644 --- a/src/lib/online/mock-service.ts +++ b/src/lib/online/mock-service.ts @@ -341,8 +341,11 @@ export class MockOnlineService implements OnlineService { async signOut() { this.session = null; - if (isBrowser()) localStorage.removeItem(LS.session); - // keep profile so progress persists across sign-ins on the same device + this.profile = null; // forget the profile so the next sign-in / guest starts clean + if (isBrowser()) { + localStorage.removeItem(LS.session); + localStorage.removeItem(LS.profile); + } } /* ----------------------------- profile ----------------------------- */ diff --git a/src/lib/online/signalr-service.ts b/src/lib/online/signalr-service.ts index c0a9867..804fefc 100644 --- a/src/lib/online/signalr-service.ts +++ b/src/lib/online/signalr-service.ts @@ -233,6 +233,7 @@ export class SignalrService implements OnlineService { this.token = null; this.cachedProfile = null; // drop the signed-in profile so it can't leak post-logout if (typeof window !== "undefined") localStorage.removeItem(LS_SESSION); + await this.mock.signOut(); // also clear the guest/fallback profile (hokm.profile) await this.conn?.stop(); this.conn = null; }