NextAuth /verify-request double-triggering, invalidating token
Hello, I'm experiencing some issues with the EmailProvider from NextAuth. Unable to find any answers online I thought I'd take my question here, if someone has had any similar issues.
So for some context, I am running MongoDB /w Prisma and this is is model for the VerificationToken (however I doubt the issue lies here)
my
auth.ts
like so:
I have placed a quick console.log in the NextAuth src, just to possibly get some more information, to which I discovered that it seems to double trigger
I am also able to see the actual session in the DB, which then gets REMOVED but still gives errors that it was "unable to find the record"
ANY help is appreciated, I've been banging my head over this for hours now and I don't understand why it's acting like thisSolution:Jump to solution
After coming back to this a few days later, I have found the problem, opening the dumb link through Outlook (because the standard Windows Mail app was not enough) it seems to trigger the endpoint on it's own somehow, invalidating the URL and then when I finally had the window open, the link was now already used.
So TL;DR: Probably use Gmail or the standard windows Mail app until it gets discontinued. If you use outlook, copy the link and paste it in the browser yourself...
2 Replies
Additional console output:
Solution
After coming back to this a few days later, I have found the problem, opening the dumb link through Outlook (because the standard Windows Mail app was not enough) it seems to trigger the endpoint on it's own somehow, invalidating the URL and then when I finally had the window open, the link was now already used.
So TL;DR: Probably use Gmail or the standard windows Mail app until it gets discontinued. If you use outlook, copy the link and paste it in the browser yourself