/application
directory.
The app comes with a UserAuthentication
component to showcase the SIWE flow and access of restricted server-side data.
.env
to configure the SIWE flow:
auth
prop, that can be used to showcase a “Sign In” state after the user connects their wallet.
When the user clicks the “Sign In” button, a message is generated and the user is prompted to sign it using their connected wallet.
authConfig
prop on the
ThirdwebProvider.
You can see this inside the _app.tsx file:
/pages/api/auth/[...thirdweb].ts
catch-all dynamic route
which handles /login
, /logout
, and /user
requests under the hood.
In this flow, the /login
route is triggered which verifies the signature and sets a thirdweb_auth_token
cookie for this user to remain
authenticated for future requests.