Hey, i got a little problem after enabling email v...
# support-questions
t
Hey, i got a little problem after enabling email verification at EmailPassword recipe.
Copy code
javascript
EmailPassword.init({
  emailVerificationFeature: {
    mode: "REQUIRED"
   }
})
I noticed this every time when i signup successfully i received two email verification email instead of one. I started to digging why this is happened and i added the createAndSendCustomEmail option to my backend setup
Copy code
typescript
EmailPasswordNode.init({
  emailVerificationFeature: {
    createAndSendCustomEmail: async (user, emailVerificationURLWithToken) => {
      console.log(user, emailVerificationURLWithToken);
    }
  }
})
The callback fired 2 times after every successful signup. I assume the root of the problem is with my frontend setup because it is the only one who is calling my backend. Do you have guys any idea what i did wrong ? 😅
n
Hi, can you follow this troubleshooting guide and post the output: https://supertokens.com/docs/emailpassword/troubleshooting/how-to-troubleshoot
t
This is a good idea, thanks 🙂
This is the log that supertokens generated. I mean except the last two object console logs.
n
Thanks, looks like your backend server is getting two requests during the email verification process (like you suspected). Can you post the code for when you call SuperTokens.init on the frontend? Include the full config object stripping away any API keys you may have used
t
This is the frontend config called from _app.tsx (Next.js). I didn't include the translation part.
n
And you are using the default UI that the SDK provides correct? Just to confirm
t
Yes. By the way i can show it.
n
Hmm we will have to look into this, in the meantime can you open an issue for this on
supertokens-auth-react
?
t
Yes, i try it 🙂
Should i include this discord thread link to the issue description ?
n
No thats alright, a description of the issue and some sample code would be plenty
t
Okay
n
You can include the logs you sent as well
@TELYA Are you running with
reactStrictMode: true
and in development mode?
t
Yes
n
When you create the issue, can you also mention if using reactStrictMode false has any effect?
t
I am about to finish it very soon. Yes i will include it.
Holy moly. After i changed reactStrictMode to false i got only one callback log 😄
n
Ah, well that should still be solved so please open that issue when you can
11 Views