Email Verification.

In my project I am using credential login and I want to add email verification to it. How can I do it. I was going to watch a video for it about auth.js but since t3 already provides some stuff I wanted to ask it here first. What should i begin with? and is the tokens in the database schema is about verification tokens?
9 Replies
Nick
Nick4w ago
I highly recommend reading The Copenhagen Book by the creator of Lucia. You can also reference Lucia's example project with email verification implemented. It's not exactly Auth.js, but the concepts are exactly the same!
The Copenhagen Book
Email verification
A basic guideline on implementing auth for the web.
GitHub
GitHub - lucia-auth/example-nextjs-email-password-2fa: Email and pa...
Email and password example with 2FA in Next.js. Contribute to lucia-auth/example-nextjs-email-password-2fa development by creating an account on GitHub.
şiar_619
şiar_619OP4w ago
thanks!
泣いオオカミー  ≛ 🏆 ≛
Yeah ita a good example but i will say there are different email verification methods The first uses a one time passcode and the other uses a link or email magic link With one time passcode, it still vulnerable to exploit since the auth example doesnt consider attempt failures But its fine if this is just a hobby project Owasp also gives guide lines for correct messages to client when doing email verification
şiar_619
şiar_619OP4w ago
thanks a lot
şiar_619
şiar_619OP4w ago
i have one more question, should i use this for email verification? t3 automatically created it when i created the project
No description
泣いオオカミー  ≛ 🏆 ≛
Thats pretty common even in Auth0 database schema example they have that It doesnt include everything needed in terms of security But it covers the basic of OTP or email magic links
şiar_619
şiar_619OP3w ago
alright thanks!
Nick
Nick3w ago
what's missing from the OTP auth example? it includes rate limiting, an auth check, and both the token and cookies have an expiration date.
泣いオオカミー  ≛ 🏆 ≛
it doesnt include the validation its just a template is what im saying but does not cover everything with regards to security

Did you find this page helpful?