Link in Verification Email leads to Error Page

Hello,

I’m using new experience version of universal login,
and now I am struggling with configuring the redirection for Verification Email.

For the “Redirect To” field in my Auth0 Email Template Settings for Verification Email,
I simply set {{ application.callback_domain }}.

With that condition, I successfully received a Verification Email after I signed up,
and with no problems I was redirected to my site’s route page automatically
after I clicked the link shown in the mail.

However, when I changed my email address via the management API with the following request body,
I also successfully received another Verification Email,
but I was redirected to the verification error page after I clicked the link in that mail:

PATCH /api/v2/users/{id}
    {
      "email_verified": false,
      "email": "foo@example.com",
      "connection": "<my web app's connection>",
      "client_id": "<my web app's client Id>"
    }

The log looks like:

{
“date”: “2020-02-06T02:43:33.419Z”,
“type”: “fv”,
“description”: “invalid result url: ?supportSignUp=true&supportForgotPassword=true&email=foo%40example.com&message=Your%20email%20was%20verified.%20You%20can%20continue%20using%20the%20application.&success=true&code=success”,
“connection”: “the connection same as what I specified in the request body”,
“connection_id”: “the connection’s id”,
“client_id”: “client id that is different from what I specified in the request body”,
“client_name”: “All Applications”,
“details”: {
“query”: {
“email”: “foo@example.com”,
“user_id”: “user’s auth0 id”,
“tenant”: “my tenant’s name”,
“client_id”: “client id that is different from what I specified in the request body”,
“connection”: “the connection same as what I specified in the request body”,
“resultUrl”: “{{ application.callback_domain }}”,
“includeEmailInRedirect”: true
},
},
}

And awkwardly, although the link showed me the error page,
the email verification itself was successfully done;
the foo@example.com is marked as verified (I mean, the email_verified field became true).

Am I missing something? Please let me know if you have any ideas.
Thank you for your help in advance.

Well everything looks good so far, just try once after clearing the cache and cookies of your browser.

Thank you for quick reply!

I tried your suggestion, but no difference.
The link in the verification email after the sign up works okay,
but not for those sent after changing emails.

I’ve just found a solution.
After updating a user’s mail address,
I send the following job request

POST /api/v2/jobs/verification-email
    {
      "user_id" : "<user's user_id>",
      "client_id": "<my web app's client Id>" ← This is very important!!!
    }

If you forget setting your client_id,
you’ll get a url link with a wrong ticket in the verification email you received.

Thank you all for helping me.

2 Likes

Perfect! Glad to hear that and thanks for sharing the solution!

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