Skip to content

Commit

Permalink
⛓ Add log out after changing chain (#842)
Browse files Browse the repository at this point in the history
* Add log out after changing chain

* Create siwe-chain-logouter.md

Co-authored-by: mj426382 <[email protected]>
  • Loading branch information
mj426382 and mj426382 authored Jun 24, 2022
1 parent d596405 commit 06cac78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/siwe-chain-logouter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@usedapp/siwe": patch
---

⛓ Add log out after changing chain
2 changes: 1 addition & 1 deletion packages/siwe/src/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const SiweProvider = ({ children, backendUrl, api }: SiweProviderProps) =
if (authToken === null) {
return
}
void getAuth(account, chainId).then((res) => (res.loggedIn ? setLoggedIn(true) : undefined))
void getAuth(account, chainId).then((res) => (res.loggedIn ? setLoggedIn(true) : setLoggedIn(false)))
}, [authToken, getAuth, account, chainId])

const signIn = useCallback(
Expand Down

3 comments on commit 06cac78

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.