Your email address could not be verified

I am creating new users via the management API and on creation they are being sent a verification email which is great, however whenever a user clicks on the link on one of these emails they get an error page saying “Your email address could not be verified” despite this the email_verified flag does seem to be updated to true. Cant seem to find anything in the logs, would prefer the users of our system didnt see the failure message, keen to try and work out why they are getting it, any thoughts,

code used for creating users below

const newUser: CreateUserData = {
    email: 'someemail@somewhere.com',
    email_verified: false,
    password: 'S0mePa$$w0rd',
    connection: 'Username-Password-Authentication'
   
    app_metadata: { isJudge: true },
  }
  const result = (await auth0.createUser(newUser)) as User<UserAppMeta>

after creation i am also assigning them a role using

 await auth0.assignRolestoUser({ id: result.user_id }, { roles: [process.env.JudgeRoleId] })

any thoughts welcome

6 Likes

I’ve never been able to reproduce it myself, but we’re currently onboarding about 40 test users to a new app using Auth0 and I’ve got a handful of reports saying the same thing. And as far as I know they’ve all actually been verified despite this error from Auth0. Pretty weird

Hey there @stein!

Are you sure it’s only a false message and those users are verified?

Hi everyone,

I am seeing the same thing with a test user I am creating using this API endpoint Auth0 Management API v2

And it’s the same behavior. When I create a user I pass “verify_email”:true
Right after the user is created the value of user.email_verified is false. After user clicks on the verification link in their email, they get brought to https://ourSubdomain.auth0.com/u/email-verification?ticket=OvGe2t5AzabzADWqgxp9VJek5yV8zwch# page that shows this error message:

Nevertheless on their user object user.email_verified is getting set to true and they can start using the system.

If I create a user through our regular registration workflow (using Lock), email verification link works and correctly redirects to our {{ application.callback_domain }}/login page.

Any insight would be appreciated.

I am having the exact same issue :frowning:

Solved it! In Redirect To field for Verification Email just put the actual value for application.callback_domain, instead of {{ application.callback_domain }}: e.g. https://mywebsite.com/login instead of {{ application.callback_domain }}/login.
Verification emails sent from auth0 dashboard or via Management API seem to have a problem when Redirect To is accessing a variable (I tried both application.callback_domain and client.callback_domain - neither worked).
Hope this helps someone!
Cheers

4 Likes

Perfect! Glad that you have figured it out and thanks for sharing with the rest of community!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.