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

nextauth and email login #3

Open
simonhlee97 opened this issue May 6, 2022 · 2 comments
Open

nextauth and email login #3

simonhlee97 opened this issue May 6, 2022 · 2 comments

Comments

@simonhlee97
Copy link

I'm not sure if it's due to an error in my env variables, or something else. Here is the error I am getting when I try to sign up or login with email.

error - unhandledRejection: Error: 4381894144:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332
@VERSAYANA
Copy link

I had the same issue, I think it's because we are using http instead of https for development.
My solution was to use this

const transporter = nodemailer.createTransport({
  host: process.env.EMAIL_SERVER_HOST,
  port: process.env.EMAIL_SERVER_PORT,
  auth: {
    user: process.env.EMAIL_SERVER_USER,
    pass: process.env.EMAIL_SERVER_PASSWORD,
  },
  secure: process.env.NODE_ENV === "production",
});

Instead of

const transporter = nodemailer.createTransport({
  host: process.env.EMAIL_SERVER_HOST,
  port: process.env.EMAIL_SERVER_PORT,
  auth: {
    user: process.env.EMAIL_SERVER_USER,
    pass: process.env.EMAIL_SERVER_PASSWORD,
  },
  secure: true,
});

In pages/api/auth/[...nextauth].js

@Giuseppe-Argento
Copy link

I had the same issue, I think it's because we are using http instead of https for development. My solution was to use this

const transporter = nodemailer.createTransport({
  host: process.env.EMAIL_SERVER_HOST,
  port: process.env.EMAIL_SERVER_PORT,
  auth: {
    user: process.env.EMAIL_SERVER_USER,
    pass: process.env.EMAIL_SERVER_PASSWORD,
  },
  secure: process.env.NODE_ENV === "production",
});

Instead of

const transporter = nodemailer.createTransport({
  host: process.env.EMAIL_SERVER_HOST,
  port: process.env.EMAIL_SERVER_PORT,
  auth: {
    user: process.env.EMAIL_SERVER_USER,
    pass: process.env.EMAIL_SERVER_PASSWORD,
  },
  secure: true,
});

In pages/api/auth/[...nextauth].js

Thank you very much for this! It helped me a lot..
Did you completed the task about the fovourites homes? It is very hard for me..any help?
Best regards..

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