fix jwt check
This commit is contained in:
@@ -27,7 +27,8 @@ export function useAccountSwitcher() {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
setPendingDid(account.did)
|
setPendingDid(account.did)
|
||||||
if (account.accessJwt) {
|
// TODO: this should be checking if it is an oauth session
|
||||||
|
if (true || account.accessJwt) {
|
||||||
if (isWeb) {
|
if (isWeb) {
|
||||||
// We're switching accounts, which remounts the entire app.
|
// 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.
|
// On mobile, this gets us Home, but on the web we also need reset the URL.
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ export const ChooseAccountForm = ({
|
|||||||
// The session API isn't resilient to race conditions so let's just ignore this.
|
// The session API isn't resilient to race conditions so let's just ignore this.
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!account.accessJwt) {
|
// TODO: this should be checking if it is an oauth session
|
||||||
|
if (!true || !account.accessJwt) {
|
||||||
// Move to login form.
|
// Move to login form.
|
||||||
onSelectAccount(account)
|
onSelectAccount(account)
|
||||||
return
|
return
|
||||||
@@ -46,7 +47,7 @@ export const ChooseAccountForm = ({
|
|||||||
try {
|
try {
|
||||||
setPendingDid(account.did)
|
setPendingDid(account.did)
|
||||||
if (true) {
|
if (true) {
|
||||||
resumeSessionOauth(account)
|
await resumeSessionOauth(account)
|
||||||
} else {
|
} else {
|
||||||
await resumeSession(account)
|
await resumeSession(account)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -270,7 +270,8 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
|
|||||||
const syncedAccount = synced.accounts.find(
|
const syncedAccount = synced.accounts.find(
|
||||||
a => a.did === synced.currentAccount?.did,
|
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 (syncedAccount.did !== state.currentAgentState.did) {
|
||||||
if (true) {
|
if (true) {
|
||||||
resumeSessionOauth(syncedAccount)
|
resumeSessionOauth(syncedAccount)
|
||||||
|
|||||||
Reference in New Issue
Block a user