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

feat: add email service and reset password flow #49

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jonkurtis
Copy link
Contributor

addresses #12 for password reset flow. also add email service with invite and reset password email templates using resend and react-email.

Copy link

vercel bot commented Sep 25, 2024

@jonkurtis is attempting to deploy a commit to the leerob-site Team on Vercel.

A member of the Team first needs to authorize it.

BrunoSette
BrunoSette approved these changes Sep 27, 2024
@CharlesCCC
Copy link

This will be a great addition. I didn't seem how the email send out ? (Do we need config some sort of smtp or ?)

@patra0o
Copy link

patra0o commented Dec 11, 2024

Great work mate. Wondering about account verification though.
What if I just sign up with a fake mail address that I do not even own?

@CharlesCCC
Copy link

@patra0o +1. I think send verification email after sign-up will be a great addition too.

Copy link

vercel bot commented Dec 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-saas-starter ❌ Failed (Inspect) Dec 12, 2024 3:11am

@jonkurtis
Copy link
Contributor Author

This will be a great addition. I didn't seem how the email send out ? (Do we need config some sort of smtp or ?)

it is setup to use Resend. You setup an account at Resend.com and add the api key as shown in .env.example

Resend was suggested as a good solution for this feature by @leerob here #12 (comment)

@jonkurtis
Copy link
Contributor Author

Great work mate. Wondering about account verification though. What if I just sign up with a fake mail address that I do not even own?

thanks.
i think that may be beyond the scope of this PR as that addresses the original Sign Up setup by @leerob prior to this PR. If this gets merged or if @leerob wants it added to get it merged i can address.

@patra0o
Copy link

patra0o commented Dec 12, 2024

Hi @jonkurtis, I am testing out locally.
Plugged in my Resend api key. but I get [{"error":"Failed to send password reset email. Please try again."},"$K1"]
Is there something else I need to change?

react: ResetPasswordEmail({
username,
email: to,
resetPasswordLink: `http://localhost:3000/reset-password?token=${token}`,
Copy link

@CharlesCCC CharlesCCC Dec 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line should be

 resetPasswordLink: `${process.env.NEXT_PUBLIC_SITE_URL}/reset-password?token=${token}`

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

Successfully merging this pull request may close these issues.

4 participants