In this experiment I look at what it takes to build password based logins with SvelteKit.
I built the following endpoints
/signup: Signup a new user
/signin: Signin with an email and password
/signout: Signout to clear cookie
/forgot-password: Request a link to reset password
/reset-password: Resets password, verifies code
Here’s the code:
- Took a little more work than expected. Just proves that authentication setup can be work. And it doesn’t even handle edge-cases.
- Missing confirmation flow
- Might be able to use Stripe Checkout to collect name and email, then registration just needs password/password confirmation to complete. That cuts down on data-entry.
- Interceptor functions seem to help a lot: https://twitter.com/joshnuss/status/1537992595392983040