Skip to content

Commit

Permalink
fixes lost session
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuascan committed Nov 26, 2024
1 parent 05d57a4 commit 62bae37
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/connectors/dedicatedWalletConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export function dedicatedWalletConnector({
disconnect: async () => {
try {
const magic = getMagicSDK()
await magic?.wallet.disconnect()
await magic?.user.logout()
localStorage.removeItem('magicRedirectResult')
config.emitter.emit('disconnect')
} catch (error) {
Expand Down Expand Up @@ -222,13 +222,13 @@ export function dedicatedWalletConnector({
}

const isLoggedIn = await magic.user.isLoggedIn()
if (isLoggedIn) return true

const result = await magic.oauth.getRedirectResult()
if (result) {
localStorage.setItem('magicRedirectResult', JSON.stringify(result))
}

if (isLoggedIn) return true


return result !== null
} catch {}
return false
Expand Down

0 comments on commit 62bae37

Please sign in to comment.