Skip to content

Commit

Permalink
fix(unlock-app): fixing signout (#12322)
Browse files Browse the repository at this point in the history
fixing signout
  • Loading branch information
julien51 committed Jul 3, 2023
1 parent 3519b80 commit 2951ec0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions unlock-app/src/hooks/useSIWE.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ export interface SIWEContextType {
isSignedIn: boolean
}

const signOut = async () => {
const signOutToken = async () => {
const session = getAccessToken()
if (session) {
await storage.revoke().catch(console.error)
removeAccessToken()
return storage.revoke().catch(console.error)
}
}

Expand All @@ -42,7 +42,7 @@ const SIWEContext = createContext<SIWEContextType>({
signIn: () => {
throw new Error('No SIWE provider found')
},
signOut,
signOut: signOutToken,
session: undefined,
isSignedIn: false,
})
Expand Down Expand Up @@ -74,7 +74,7 @@ export const SIWEProvider = ({ children }: Props) => {
const signOut = async () => {
try {
setStatus('loading')
await signOut()
await signOutToken()
await Promise.all([queryClient.invalidateQueries(), refetchSession()])
setStatus('idle')
} catch (error) {
Expand Down

0 comments on commit 2951ec0

Please sign in to comment.