# Auth0 Require Email Verification issues

**URL:** <https://community.auth0.com/t/auth0-require-email-verification-issues/115976>\
**Category:** Get Help\
**Tags:** email-verification, user-management\
**Created:** [September 12, 2023, 9:03am UTC](https://community.auth0.com/t/auth0-require-email-verification-issues/115976 "2023-09-12T09:03:30Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbh](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mbh/32/50755_2.png) [@mbh](https://community.auth0.com/u/mbh)\
**Post date:** [September 12, 2023, 9:03am UTC](https://community.auth0.com/t/auth0-require-email-verification-issues/115976/1 "2023-09-12T09:03:30Z")

</div>

Hi,

We use this Require Email Verification from Auth0 to ensure our users verify their e-mail before signing in. This offen gives a issue as the customers don’t seems to be looking on their mails before moving on.

The only information send back to us in the URL is “Access Denied” nothing more. So how can we inform our customers that they need to verify their email before moving on.?

This is the module we use : [https://marketplace.auth0.com/integrations/auth-0-require-email-verification?tab=install](https://marketplace.auth0.com/integrations/auth-0-require-email-verification?tab=install)

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [September 12, 2023, 8:24pm UTC](https://community.auth0.com/t/auth0-require-email-verification-issues/115976/3 "2023-09-12T20:24:11Z")

</div>

Hi @mbh,

Welcome to the Auth0 Community!

I have just checked the [Require Email Verification integration](https://marketplace.auth0.com/integrations/auth-0-require-email-verification) you shared and found, in the installation steps, it states that you should be able to configure the integration’s Error Message to set your preferred `error_description`.

However, when I tried to test this integration, I was not able to configure the integration’s error message.

Given that, I will let our Engineering teams know about this issue to have them look at this.

In the meantime, you could implement this Post-Login Action script as a workaround:

```auto
exports.onExecutePostLogin = async (event, api) => {
  if (!event.user.email_verified) {
    api.access.deny(`Please verify your email before continuing.`);
  }
};

```

Please let me know if you have any questions.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![mbh](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mbh/32/50755_2.png) [@mbh](https://community.auth0.com/u/mbh)\
**Post date:** [September 22, 2023, 5:36pm UTC](https://community.auth0.com/t/auth0-require-email-verification-issues/115976/5 "2023-09-22T17:36:39Z")

</div>

The provided code here, don’t work.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [September 22, 2023, 5:44pm UTC](https://community.auth0.com/t/auth0-require-email-verification-issues/115976/6 "2023-09-22T17:44:37Z")

</div>

Hi @mbh,

I have just tested this on my end and can confirm that the provided code works.

See screenshot below:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/f/b/fb9a9f092cee2f9fa9b960b79d1936886dd69b92.png)

Could you provide more details on the issue you are experiencing?

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![mbh](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mbh/32/50755_2.png) [@mbh](https://community.auth0.com/u/mbh)\
**Post date:** [September 22, 2023, 7:03pm UTC](https://community.auth0.com/t/auth0-require-email-verification-issues/115976/7 "2023-09-22T19:03:18Z")

</div>

Sure the customers do still get the “access denied” even after i added the code and all.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [September 22, 2023, 11:19pm UTC](https://community.auth0.com/t/auth0-require-email-verification-issues/115976/8 "2023-09-22T23:19:34Z")

</div>

Hi @mbh,

Yes, they should see the URL structure that looks something like the following:

`https://yourApp/callback?error=access_denied&error_description=%5Btest%5D%20force%20email%20verification%20action%20-%20Please%20verify%20your%20email%20address%20to%20continue%20to%Test%20Application&state=yourState`

---

<div class="post-metadata">

**Author:** ![mbh](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mbh/32/50755_2.png) [@mbh](https://community.auth0.com/u/mbh)\
**Post date:** [September 23, 2023, 8:55am UTC](https://community.auth0.com/t/auth0-require-email-verification-issues/115976/9 "2023-09-23T08:55:50Z")

</div>

I see the url that is coming back is :  
[https://www.joybuggy.com/en/](https://www.joybuggy.com/en/) checkout?error=access\_denied&error\_description=Access%20Denied&state=e4476cdd0693fc6cf823aa3dd9bfc141

Their are no more information then that. So it’s not really very usefull, when i go into the monitor part of auth0 i can see that the “issue” is that they has not yet verifyed their e-mail.

This “access denied” issue here is costing us a good amount of money ;(

---

<div class="post-metadata">

**Author:** ![mbh](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mbh/32/50755_2.png) [@mbh](https://community.auth0.com/u/mbh)\
**Post date:** [September 23, 2023, 9:31am UTC](https://community.auth0.com/t/auth0-require-email-verification-issues/115976/10 "2023-09-23T09:31:48Z")

</div>

Here is a user :

Raw data :

```auto
{
  "date": "2023-09-23T06:00:33.343Z",
  "type": "f",
  "description": "Access Denied",
  "connection_id": "",
  "client_id": "XX",
  "client_name": "Joybuggy.com Login",
  "ip": "XXX",
  "user_agent": "Firefox 117.0.0 / Windows 10.0.0",
  "details": {
    "body": {},
    "qs": {
      "state": "e4476cdd06dd9bfc141",
      "client_id": "XX",
      "redirect_uri": "https://www.joybuggy.com/en/checkout",
      "scope": "openid profile email",
      "response_mode": "query",
      "response_type": "code",
      "nonce": "0600d00c9f876a512f3181b43990e131",
      "code_challenge": "y9UiqJGbXO_nkrHjyFYJYO6dkEm2eXzq3Y2y3S64k5s",
      "code_challenge_method": "S256"
    },
    "error": {
      "message": "Access Denied",
      "oauthError": "access_denied",
      "type": "oauth-authorization"
    },
    "session_id": "8Bu8sWKttnUDr7m-EvgGvFsdpieLzFuh",
    "actions": {
      "executions": [
        "t2ajUYauRteGLll8MMb6DzIwMjMwOTIz"
      ]
    },
    "stats": {
      "loginsCount": 1
    }
  },
  "hostname": "joybuggy.eu.auth0.com",
  "user_id": "auth0|658589a0f1c7cd7706e",
  "user_name": "@.com",
  "audience": "https://joybuggy.eu.auth0.com/userinfo",
  "scope": [
    "openid",
    "profile",
    "email"
  ],
  "log_id": "90020230923060033408424000000000000001223372037860267257",
  "_id": "90020230923060033408424000000000000001223372037860267257",
  "isMobile": false,
  "id": "90020230923060033408424000000000000001223372037860267257"
}

```

Context data :

```auto
{
  "body": {},
  "qs": {
    "state": "xx",
    "client_id": "xx",
    "redirect_uri": "https://www.joybuggy.com/en/checkout",
    "scope": "openid profile email",
    "response_mode": "query",
    "response_type": "code",
    "nonce": "0600d00c9f876a512f3181b43990e131",
    "code_challenge": "y9UiqJGbXO_nkrHjyFYJYO6dkEm2eXzq3Y2y3S64k5s",
    "code_challenge_method": "S256"
  },
  "error": {
    "message": "Access Denied",
    "oauthError": "access_denied",
    "type": "oauth-authorization"
  },
  "session_id": "-",
  "actions": {
    "executions": [
      "t2ajUYauRteGLll8MMb6DzIwMjMwOTIz"
    ]
  },
  "stats": {
    "loginsCount": 1
  }
}

```

 ![Skærmbillede 2023-09-23 kl. 11.31.15](https://global.discourse-cdn.com/auth0/original/3X/9/a/9a892ac76440815ee53752c483ebf80a35f35154.png)

So why do i not get any error messages here on why the user is blocked??

As you see below here we have a good amount of “failed signups” without any information on why other then “access denied” - We can’t even see why, how shell the customer know or our customer support help the customers?

 ![Skærmbillede 2023-09-23 kl. 11.33.06](https://global.discourse-cdn.com/auth0/original/3X/d/6/d6505724f457af109ad700a4d8eb1814d5cd6fa9.png)

Below here are my settings, did i set it up wrongly?

 ![Skærmbillede 2023-09-23 kl. 11.37.07](https://global.discourse-cdn.com/auth0/original/3X/5/4/5488500221dccdcec4f76e06da8db6c00b00813d.png)  
 ![Skærmbillede 2023-09-23 kl. 11.37.20](https://global.discourse-cdn.com/auth0/original/3X/a/5/a56f8ddc45e4e5e469c924523c4ad3f989882a01.png)  
 ![Skærmbillede 2023-09-23 kl. 11.37.36](https://global.discourse-cdn.com/auth0/original/3X/7/b/7bacad31bb9734c899acf3db49993a6a677a022f.png)  
 ![Skærmbillede 2023-09-23 kl. 11.38.16](https://global.discourse-cdn.com/auth0/original/3X/d/b/dbab403e815abf929f72a82e2083ea51e07dff14.png)

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [September 25, 2023, 4:07pm UTC](https://community.auth0.com/t/auth0-require-email-verification-issues/115976/11 "2023-09-25T16:07:41Z")

</div>

Hi @mbh,

The issue is happening because you have 2 redundant Actions that require users to verify their email before logging in.

Specifically, you need to remove the “Require Email Verification” Integration and keep the custom “Add error message to verify e-mail” Action in your Post Login Action flow.

 ![image](https://global.discourse-cdn.com/auth0/original/3X/c/2/c2917edad3d8b7b0f91862d4f4178eca3c990bda.jpeg)

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![mbh](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mbh/32/50755_2.png) [@mbh](https://community.auth0.com/u/mbh)\
**Post date:** [September 25, 2023, 6:32pm UTC](https://community.auth0.com/t/auth0-require-email-verification-issues/115976/12 "2023-09-25T18:32:27Z")

</div>

Will the code you provided first here, still force the user to verify the e-mail.?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [September 26, 2023, 3:21pm UTC](https://community.auth0.com/t/auth0-require-email-verification-issues/115976/13 "2023-09-26T15:21:15Z")

</div>

Hi @mbh,

Yes, the code I provided in my initial response will force the user to verify their email before logging in.

I recommend giving it a try and letting me know how it goes.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [October 10, 2023, 3:21pm UTC](https://community.auth0.com/t/auth0-require-email-verification-issues/115976/14 "2023-10-10T15:21:40Z")

</div>

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