Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lucia branch: Suggestion: Send email after successful sign up #132

Open
Boscop opened this issue Dec 28, 2023 · 4 comments
Open

Lucia branch: Suggestion: Send email after successful sign up #132

Boscop opened this issue Dec 28, 2023 · 4 comments

Comments

@Boscop
Copy link

Boscop commented Dec 28, 2023

Currently the user receives no email when signing up successfully.
Suggestion: Send email to user after successful sign up.

@rmarscher
Copy link
Contributor

I sort of intentionally left it open for the developer using this starter project to implement email or sms notifications on their own because it's opinionated. You need to decide what provider to use and what you want to include in the email. You also might want to require email verification before you allow access. I added one email example for sending a password reset email via Resend. https://github.com/timothymiller/t4-app/blob/lucia/packages/api/src/auth/user.ts#L205-L223

@Boscop
Copy link
Author

Boscop commented Dec 28, 2023

Ah yeah.
Can we add code that sends an email with a verification link if the user signs up with email instead of oauth? :)
Since it's very common to have such an email after sign up. (And unnecessary when the user signed up via oauth because that provider already asked them to verify their email address when they signed up there.)
I think it would make sense to have this in the lucia branch/template.

(I'm using Resend for now, but the email sending logic could stay the same regardless of the actual provider that people will use.)

@timothymiller
Copy link
Owner

Ah yeah. Can we add code that sends an email with a verification link if the user signs up with email instead of oauth? :) Since it's very common to have such an email after sign up. (And unnecessary when the user signed up via oauth because that provider already asked them to verify their email address when they signed up there.) I think it would make sense to have this in the lucia branch/template.

(I'm using Resend for now, but the email sending logic could stay the same regardless of the actual provider that people will use.)

I agree with this. I will implement a PR.

@rmarscher
Copy link
Contributor

@timothymiller FYI here are the new docs getting created around email verification for lucia v3 - https://v3.lucia-auth.com/guides/email-and-password/email-verification-codes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants