#The google provider worked flawlessly
1 messages ยท Page 1 of 1 (latest)
[next-auth][error][SIGNIN_EMAIL_ERROR]
These are the docs for that particular error, but I feel pretty certain that I have the smtp connection string correct. https://next-auth.js.org/errors#signin_email_error
This is a list of errors output from NextAuth.js.
that is my [...nextauth].js file
and I have those key value pairs in my .env.local file.
GMAIL_SERVER=smtp://emailaddress:gmailpassword@smtp.google.com:587
GMAIL_FROM=emailaddress
I disabled the "block unsafe applications" feature in google
it worked for me a single time, then never again and now I can't get it to work with any smtp provider
I did do a minor node update, do you think that broke nodemailer?
Hold on, are the emails being sent?
Or did the error show up after you clicked on that first email that was sent successfully?
And you clicked on the link in that email, right?
And that's when the error appeared?
No. I was able to authenticate that first time. It all worked fine.
Ah, OK.
Logged me in, I used the site. Then I deleted that user from the db and tried again and it hasn't worked since.
How did you delete it from the db? Manually?
yeah, from Mongo Atlas
Shouldn't have done that. ๐
Did you also delete all the sessions, accounts, and tokens related to that user?
I did not.
OK, now the database is corrupt.
Is it possible to drop and recreate it, then start again?
I would think that should be easy enough it's only test data in there now.
OK, please try that. If it starts working afterwards, then my diagnosis is correct.
If it still fails, we need a new theory... ๐
I get this error in the UI even before I enter an email address, btw
I'd still start with a clean db, just to eliminate that factor.
And restart the NextJS server.
ok, I will try that.
Good luck.
thanks! haha
ok I dropped the whole db, I made only the collections that I use for my content. I was able to sign in with Google like before and next-auth created its normal collections users, tokens, etc
but I am still not able to use the email provider
are you familiar with other smtp setups for next-auth that aren't google? I feel like it's their security blocking me.
I hope you're using a generated app password, not your real password? I've had GMail reject git sendmail for that reason before.
I am not...
OK, that's the first thing to try.
Tip: App Passwords arenโt recommended and are unnecessary in most cases. To help keep your account secure, use "Sign in with Google" to connect apps to your Google Account.ย
An App Password is
(BTW, do you have 2FA on for that Google account?)
google always asks if it's me trying to sign in and I have to tap yes on my phone. Is that their 2Fa?
Yes! ๐
No wonder it doesn't work from NextAuth.
Try generating an app password and using it in NextAuth.
Ok. I have my 16 char app password. Just pasted it and restarting my app. Fingers crossed.
other question. Is the username still my email then?
I think so. NextAuth doesn't seem to have the concept of a username. Email is the closest thing to it that I know.
still not working.
(Maybe the Credentials adapter has the username concept, but it's nowhere in this schema: https://next-auth.js.org/adapters/models)
What's the error now?
(when you try to send the email)
Samer
๐ฆ
I get an error as soon as I click on "sign in with email"
Wait, it doesn't let you enter an email first?
The stack trace indicates that either email or host is null on one of these lines: https://github.com/nextauthjs/next-auth/blob/81afeef1949aba30cd78c18e830aaa9be6d8a354/packages/next-auth/src/providers/email.ts#L94-L95
I don't know what to do with that information lol
OK, I think the error is because the email address you want to send the link to is null.
First off: what happens if you enter a valid email and click "Sign in with Email"?
it just loads for an exceptionally long time then fails on a timeout
Any errors in the log?
Yeah, that's NextAuth failing to connect to a Google server.
same thing with a different email
OK, time to try a different SMTP provider.
There's a slight chance that your IP has been blackholed as a "known spammer".
well that would be shitty
who has the lowest standards? lol
Hmmm...
I signed up for a sendgrid account but I couldn't figure out their connection string
I don't think the IP ban is a high probability. But it's definitely time to try another SMTP provider, just to check what happens.
smtp://apikey:<myapikey>@smtp.sendgrid.net:587
tried that with no luck still.
made sure my email was verified with sendgrid first
Another timeout?
Ignore that for now, that's a separate error that's likely trivial.
Enter a valid email and hit the button.
still timing out. I am gonna try port 25
Also try from a different IP (eg, via VPN or phone tether).
I will try my phone
yoooooooo
It worked with my phone
no effin way
it was my IP
do you have a Venmo I can send $10 to?
Heh, no. But pleaes check out chiselstrike.com and maybe give us a GitHub star or smtg. ๐
We're good people...