Skip to content

Commit 6469e1f

Browse files
committed
aways save login during init
1 parent 74dfd7b commit 6469e1f

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

frontend/src/utils/AuthService.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,12 @@ export default class AuthService {
183183

184184
if (!authState) {
185185
authState = await this.getSharedSessionAuth();
186+
}
186187

187-
if (authState) {
188-
this.saveLogin(authState);
189-
} else {
190-
AppStateService.updateAuth(null);
191-
}
188+
if (authState) {
189+
this.saveLogin(authState);
190+
} else {
191+
AppStateService.updateAuth(null);
192192
}
193193

194194
return authState;

frontend/src/utils/state.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ export function makeAppStateService() {
3939
auth: Auth | null = null;
4040

4141
// Store logged-in flag in local storage so that tabs know whether to
42-
// check auth again when focused
42+
// check auth again when focused.
43+
// This can get out of sync with `auth` if any other tabs log in/out.
4344
@options(persist(window.localStorage))
4445
loggedIn: boolean | null = null;
4546

0 commit comments

Comments
 (0)