Sign-In with Substrate
This is an example full stack Next.JS dApp for implementing Sign-In with Substrate. It can be used as a reference for adding authentication to your dApp using just Substrate wallets, no third party providers needed!
The example dApp has a /api/protected
route that only authenticated users can access. From the UI, you will see how the sign in process works after connecting your wallet. After that you may use the /api/protected
to generate random text! In reality, you will issue a JWT token with some custom claims, that will later be used to query data from your database in your protected APIs.
- Install dependencies
$ npm run install
- Start the dev server
$ npm run dev
- Visit the example app at
https://localhost:3000
Check out our full guide on how to implement SIWS into your dapp!