Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/every-sides-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

Automatically trigger SIWE sign in when a wallet is connected
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,24 @@ function ConnectButtonInner(
}
}, [activeAccount]);

// if the wallet is connected and auth is required, trigger a login attempt automatically
useEffect(() => {
if (
activeAccount &&
Copy link
Member

Choose a reason for hiding this comment

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

I think we should only do this for in app wallets. Coz on mobile you really need an explicit click otherwise things break quickly.

siweAuth.requiresAuth &&
!siweAuth.isLoggedIn &&
!siweAuth.isLoggingIn
) {
siweAuth.doLogin();
}
}, [
activeAccount,
siweAuth.requiresAuth,
siweAuth.doLogin,
siweAuth.isLoggedIn,
siweAuth.isLoggingIn,
]);

const theme = props.theme || "dark";
const connectionStatus = useActiveWalletConnectionStatus();
const locale = props.connectLocale;
Expand Down
Loading