#The google provider worked flawlessly

1 messages ยท Page 1 of 1 (latest)

dusk marsh
#

Tell us more. What exactly isn't working? Any error messages?

misty hare
#

[next-auth][error][SIGNIN_EMAIL_ERROR]

#

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?

dusk marsh
#

Hold on, are the emails being sent?

#

Or did the error show up after you clicked on that first email that was sent successfully?

misty hare
#

it did end up breaking after the first email was sent duccessfully.

#

successfully*

dusk marsh
#

And you clicked on the link in that email, right?

#

And that's when the error appeared?

misty hare
#

No. I was able to authenticate that first time. It all worked fine.

dusk marsh
#

Ah, OK.

misty hare
#

Logged me in, I used the site. Then I deleted that user from the db and tried again and it hasn't worked since.

dusk marsh
#

How did you delete it from the db? Manually?

misty hare
#

yeah, from Mongo Atlas

dusk marsh
#

Shouldn't have done that. ๐Ÿ™‚

#

Did you also delete all the sessions, accounts, and tokens related to that user?

misty hare
#

I did not.

dusk marsh
#

OK, now the database is corrupt.

#

Is it possible to drop and recreate it, then start again?

misty hare
#

I would think that should be easy enough it's only test data in there now.

dusk marsh
#

OK, please try that. If it starts working afterwards, then my diagnosis is correct.

#

If it still fails, we need a new theory... ๐Ÿ™‚

misty hare
#

I get this error in the UI even before I enter an email address, btw

dusk marsh
#

I'd still start with a clean db, just to eliminate that factor.

#

And restart the NextJS server.

misty hare
#

ok, I will try that.

dusk marsh
#

Good luck.

misty hare
#

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.

dusk marsh
#

I hope you're using a generated app password, not your real password? I've had GMail reject git sendmail for that reason before.

misty hare
#

I am not...

dusk marsh
#

OK, that's the first thing to try.

#

(BTW, do you have 2FA on for that Google account?)

misty hare
#

google always asks if it's me trying to sign in and I have to tap yes on my phone. Is that their 2Fa?

dusk marsh
#

Yes! ๐Ÿ™‚

#

No wonder it doesn't work from NextAuth.

#

Try generating an app password and using it in NextAuth.

misty hare
#

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?

dusk marsh
#

I think so. NextAuth doesn't seem to have the concept of a username. Email is the closest thing to it that I know.

misty hare
#

still not working.

dusk marsh
#

What's the error now?

#

(when you try to send the email)

misty hare
#

Samer

dusk marsh
#

๐Ÿ˜ฆ

misty hare
#

I get an error as soon as I click on "sign in with email"

dusk marsh
#

Wait, it doesn't let you enter an email first?

misty hare
#

no

dusk marsh
misty hare
#

I don't know what to do with that information lol

dusk marsh
#

don't worry, I'm just kinda taking notes here.

#

And you installed nodemailer, right?

misty hare
dusk marsh
#

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"?

misty hare
#

it just loads for an exceptionally long time then fails on a timeout

dusk marsh
#

Any errors in the log?

misty hare
#

the identifier is the email I entered in to the field

dusk marsh
#

Yeah, that's NextAuth failing to connect to a Google server.

misty hare
#

same thing with a different email

dusk marsh
#

OK, time to try a different SMTP provider.

#

There's a slight chance that your IP has been blackholed as a "known spammer".

misty hare
#

well that would be shitty

dusk marsh
#

Which makes SMTP servers dislike you. ๐Ÿ™‚

#

There's always VPN... ๐Ÿ˜‰

misty hare
#

who has the lowest standards? lol

dusk marsh
#

Hmmm...

misty hare
#

I signed up for a sendgrid account but I couldn't figure out their connection string

dusk marsh
#

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.

misty hare
#

smtp://apikey:<myapikey>@smtp.sendgrid.net:587

#

tried that with no luck still.

#

made sure my email was verified with sendgrid first

dusk marsh
#

Another timeout?

misty hare
#

"The e-mail could not be sent."

#

even before one is entered

dusk marsh
#

Ignore that for now, that's a separate error that's likely trivial.

#

Enter a valid email and hit the button.

misty hare
#

still timing out. I am gonna try port 25

dusk marsh
#

Also try from a different IP (eg, via VPN or phone tether).

misty hare
#

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?

dusk marsh
#

Heh, no. But pleaes check out chiselstrike.com and maybe give us a GitHub star or smtg. ๐Ÿ˜‰

#

We're good people...

misty hare
#

You legit saved my life my guy

#

I was losing it over here haha

dusk marsh
#

Always happy to help.

#

We all gotta look out for each other.