This is a POC to show high level patterns. You should generate more secure one time use messages if using this in production. See WIP Database Integration.
Example implementation of "Sign in With Solana" using SvelteKit.
- User selects a wallet using
@svelte-on-solana/wallet-adapter-ui
. - Upon wallet connection, hit endpoint
/api/solana/message
to get a time sensitive message. - Use wallet adapter to sign a message.
- Send message signature and other details to
/api/solana/message/verify
.
- Have Node installed
npm install
in the project directory.- Add a
.env
file to the root of this project and add a TOTP secret likeENV_TOTP_SECRET=12312312
. Both endpoints use this value to create and verify the time sensitive code. npm run dev
to start the project locally.
Tweet at me @_qudo