mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 05:25:40 +09:00
fix(app): keep hydrated state across gateway session resumes (#1862)
This commit is contained in:
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');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user