Auth0 email verification redirect issue: Access denied error

Hi! I’m setting up Auth0 with 2FA and sending a verification email to confirm the user’s email before they can access the app. However, when the email is sent through Auth0 (and before the user has authenticated), I’m redirected to this URL: “https://accounts.appfarm.io/v1/callback?error=access_denied&error_description=Invalid%20URL&state=cQstCv1vZfoMNvZpnRr9Zrp9apqbePGy3xr1HYFpZKNLHioS
Does anyone know how I can redirect users to a specific landing page instead? Thanks!

Hi @Elin-ENVE ,

To customize where users land post-verification, you can set a specific URL in the “Redirect To” field in Auth0’s Verification Email template settings.

Have you already tried the following steps?

  1. Open your Auth0 Dashboard and navigate to Branding > Email Templates.

  2. Select the Verification Email template to edit.

  3. In the “Redirect To” field, enter the URL you’d like users to land on after verifying their email. For instance, “{{ application.callback_domain }}/login” can redirect them to your login page.

  4. Add the Redirect URL to Allowed Callback URLs: Make sure “{{ application.callback_domain }}/login” (or the specific URL you’re using) is included in your app’s Allowed Callback URLs under the Auth0 settings. This step can prevent the access_denied error that’s currently occurring.

If you’ve already done this and it’s still not working, let me know, and I’d be happy to help troubleshoot further!

Thank you for the tips!

I realize I could have explained more clearly. The error occurs before users click the verification link in the email. It happens during registration, right after the verification email is sent. Ideally, users should be redirected to a page instructing them to check their email to verify their account. However, they’re currently being redirected to an error page instead.

@Simona do you have any recommendations on what I could do or look into to solve this?

Hei @Elin-ENVE,

Could you double-check that https://accounts.appfarm.io/v1/callback is included in your “Allowed Callback URLs” in the Auth0-portal under Applications → Settings?

Also, sometimes custom rules can disrupt the usual flow. Try going to Actions > Flows > Login in Auth0 to see if there are any rules that might be triggering a redirect or error at this point.

Auth0’s logs can be very useful for diagnosing issues like this. You’ll find them under Monitoring > Logs. This might help clarify why the redirect isn’t working.

Hi @Simona
Im adding two images to demonstrate the issue. When entering the email and clicking continue i am directly redirected to the callback, and not the “waiting page” while the email is verified. Hopefully this gives some more detail about what we ca do.