Goal
When a user submits their email on the sign-in form, they receive a real magic-link email. Clicking the link signs them in and creates a session in Mongo.
Tasks
Configure the Nodemailer transport
Verify the existing Mailgun setup
Customize the email template
Verify Mongo adapter is creating the right collections
End-to-end test
Definition of done
Goal
When a user submits their email on the sign-in form, they receive a real magic-link email. Clicking the link signs them in and creates a session in Mongo.
Tasks
Configure the Nodemailer transport
src/lib/auth/config.tsand locate theEmailProviderconfiguration object.serverfield to a real Nodemailer transport built from the env varsEMAIL_SERVER_HOST,EMAIL_SERVER_PORT,EMAIL_SERVER_USER,EMAIL_SERVER_PASSWORD.fromfield to the value ofEMAIL_FROMenv var.registration@hackbeanpot.com..env.exampleand have real values in local.env. If.env.exampleis missing any, add them.Verify the existing Mailgun setup
Customize the email template
sendVerificationRequestfunction on theEmailProvider.urlparameter tosendVerificationRequest), not a hardcoded URL.Verify Mongo adapter is creating the right collections
users,accounts,sessions,verification_tokens.src/lib/auth/adapter.tsis wrong.usersdocument has the email address you signed in with.End-to-end test
/auth/signin, enter an email, submit, open your real inbox), click the link in the email, confirm you land somewhere as a signed-in user.Definition of done