From e4625c9014d2cf67c92093f66cb3a5e1ed16822a Mon Sep 17 00:00:00 2001 From: Hailey Date: Fri, 18 Jul 2025 11:29:49 -0700 Subject: [PATCH] fix jwt check --- src/lib/hooks/useAccountSwitcher.ts | 3 ++- src/screens/Login/ChooseAccountForm.tsx | 5 +++-- src/state/session/index.tsx | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/lib/hooks/useAccountSwitcher.ts b/src/lib/hooks/useAccountSwitcher.ts index e54b5c1518..3f1d34317e 100644 --- a/src/lib/hooks/useAccountSwitcher.ts +++ b/src/lib/hooks/useAccountSwitcher.ts @@ -27,7 +27,8 @@ export function useAccountSwitcher() { } try { setPendingDid(account.did) - if (account.accessJwt) { + // TODO: this should be checking if it is an oauth session + if (true || account.accessJwt) { if (isWeb) { // We're switching accounts, which remounts the entire app. // On mobile, this gets us Home, but on the web we also need reset the URL. diff --git a/src/screens/Login/ChooseAccountForm.tsx b/src/screens/Login/ChooseAccountForm.tsx index 885ae21a79..bf8473a326 100644 --- a/src/screens/Login/ChooseAccountForm.tsx +++ b/src/screens/Login/ChooseAccountForm.tsx @@ -33,7 +33,8 @@ export const ChooseAccountForm = ({ // The session API isn't resilient to race conditions so let's just ignore this. return } - if (!account.accessJwt) { + // TODO: this should be checking if it is an oauth session + if (!true || !account.accessJwt) { // Move to login form. onSelectAccount(account) return @@ -46,7 +47,7 @@ export const ChooseAccountForm = ({ try { setPendingDid(account.did) if (true) { - resumeSessionOauth(account) + await resumeSessionOauth(account) } else { await resumeSession(account) } diff --git a/src/state/session/index.tsx b/src/state/session/index.tsx index f39762b1bd..c85faab79f 100644 --- a/src/state/session/index.tsx +++ b/src/state/session/index.tsx @@ -270,7 +270,8 @@ export function Provider({children}: React.PropsWithChildren<{}>) { const syncedAccount = synced.accounts.find( a => a.did === synced.currentAccount?.did, ) - if (syncedAccount && syncedAccount.refreshJwt) { + // TODO: this should be checking if it is an oauth session + if (syncedAccount && (true || syncedAccount?.refreshJwt)) { if (syncedAccount.did !== state.currentAgentState.did) { if (true) { resumeSessionOauth(syncedAccount)