fix(app): keep hydrated state across gateway session resumes (#1862)

This commit is contained in:
Hampus authored and GitHub committed 2026-08-24 12:33:27 +02:00
1 parent b7f75e25ad
commit 943b948de7
41 files changed
+81 -690

No files matched your search

@@ -16,7 +16,7 @@ class AuthSessions {
makeAutoObservable(this, {}, {autoBind: true});
}
handleConnectionOpen(authSessionIdHash: string): void {
handleGatewayReady(authSessionIdHash: string): void {
this.authSessionIdHash = authSessionIdHash;
}
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import * as RouterUtils from '@app/features/navigation/utils/RouterUtils';
import SessionManager from '@app/features/platform/state/AuthSession';
import type {ValueOf} from '@fluxer/constants/src/ValueOf';
import type {UserPrivate} from '@fluxer/schema/src/domains/user/UserResponseSchemas';
@@ -73,7 +72,7 @@ class Authentication {
}
@action
handleConnectionOpen({user}: {user: UserPrivate}): void {
handleGatewayReady({user}: {user: UserPrivate}): void {
SessionManager.setUserId(user.id);
SessionManager.handleConnectionReady();
}
@@ -128,7 +127,9 @@ class Authentication {
this.mfaTicket = null;
this.mfaMethods = null;
if (!options?.skipRedirect) {
RouterUtils.replaceWith('/login');
void import('@app/features/navigation/utils/RouterUtils').then((module) => {
module.replaceWith('/login');
});
}
}