Example implementation of "Sign in With Solana" using SvelteKit.
@svelte-on-solana/wallet-adapter-ui
./api/solana/message
to get a time sensitive message./api/solana/message/verify
.From here, if the verification is successful, the backend could do something like prepare a JWT to send back to the user.
npm install
in the project directory..env
file to the root of this project and add a TOTP secret like ENV_TOTP_SECRET=12312312
. Both endpoints use this value to create and verify the time sensitive code. npm run dev
to start the project locally.There are a couple non intuitive config things I had to do in order to polyfill Buffer
. See vite.config.js
and +layout.svelte
for implementing a browser version of `Buffer.
Tweet at me @_qudo