Open Frdnspnzr opened 1 year ago
It still happens from time to time in preview deployments. It seems to fix the issue when deleting old verification tokens or sessions from the database.
I have now tried several providers locally and in preview and it still doesn't work.
This seems to explain it pretty well? That would explain it working occasionally: When the function finishes fast enough to send the email. It would also explain it working after database operations: This may add some additional overhead when re-establishing the database connection, thereby giving the function enough time to finish.
As next-auth supports overwriting the email sending functionality it may be worth to give the soltion in the StackOverflow thread a shot.
After several hours of testing different email service providers I may have finally found one that works for me. It looks like nothing in the code needs to change and I can just plug in a faster SMTP server this way. I will keep this issue open for another while just to make sure there aren't any more problems.
The E-Mail login was broken multiple times for multiple users. Unfortunately I can't even pinpoint what exactly goes wrong right now.