How to avoid page load when verifying email with NextAuth
Hi,
I'm new to the T3 stack and web dev as a whole, and as the title implies, I'm trying to stay on the same page without reloading it when calling NextAuth's signIn() method with the Email provider. In a settings page, the user can change their e-mail but must verify it by pressing a button. The button handler is calling NextAuth's signIn() as shown below
All I want is for the user to be sent the e-mail that the default Email sign in sends when they click the button, and I thought
redirect:false would do the job, but it doesn't. How should I proceed?
Thanks in advance7 Replies
It works normally for me 🙂 Did you setup the DB adapter?
But yeah you're right, it works, I get the email and I don't have a page reload... but I don't want to disable TS rules 😅
You don't need to assign the response I think, just this should work:
Idk what is this promise-returning error, I don't have it 😄
You can make it IIFE or disable the rule
I'm on
"typescript": "^4.9.5" and "@typescript-eslint/parser": "^5.53.0",ohhh, cool! Been adding void returns everywhere for no reason... thank you very much for helping, appreciate it 🙂