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: lazily import nodemailer #4824

Closed
wants to merge 2 commits into from
Closed

feat: lazily import nodemailer #4824

wants to merge 2 commits into from

Conversation

mmkal
Copy link
Contributor

@mmkal mmkal commented Jul 3, 2022

I'm roughly following/adapting this guide for sending a six-digit code via email: https://www.ramielcreations.com/nexth-auth-magic-code

I would like to use it in a stack where we're using Amazon SES as an emailing abstraction, rather than an SMTP server directly. And while developing, it has been useful to just console.log the verification code in a custom sendVerificationRequest implementation. One snag I hit, though, was that not having the nodemailer dependency installed caused an error just by requiring the EmailProvider, even though it's only used in one place, that I was overriding anyway. I've seen in #1913 and some other related issues/discussions that there may be willingness to create a non-email-biased PasswordlessProvider in future. But for now this step is a really simple code change to make and decreases the nodemailer dependency without needing to create a whole new provider.

mmkal added 2 commits July 3, 2022 17:15
I'm roughly following/adapting this guide for sending a six-digit code via email: https://www.ramielcreations.com/nexth-auth-magic-code

I would like to use it in a stack where we're using Amazon SES as an emailing abstraction, rather than an SMTP server directly. And while developing, it has been useful to just `console.log` the verification code in a custom `sendVerificationRequest` implementation. One snag I hit, though, was that not having the `nodemailer` dependency installed caused an error just by requiring the `EmailProvider`, even though it's only used in one place, that I was overriding anyway. I've seen in nextauthjs#1913 and some other related issues/discussions that there may be willingness to create a non-email-biased `PasswordlessProvider` in future. But for now this step is a really simple code change to make and decreases the `nodemailer` dependency without needing to create a whole new provdier.
@vercel
Copy link

vercel bot commented Jul 3, 2022

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

1 Ignored Deployment
Name Status Preview Updated
next-auth ⬜️ Ignored (Inspect) Jul 3, 2022 at 9:19PM (UTC)

@github-actions github-actions bot added core Refers to `@auth/core` providers labels Jul 3, 2022
@balazsorban44
Copy link
Member

Please see #3168 (comment)

@balazsorban44
Copy link
Member

I recommend creating your own email provider for this case for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Refers to `@auth/core` providers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants