# User can sign in before email confirmation

**URL:** <https://community.auth0.com/t/user-can-sign-in-before-email-confirmation/62730>\
**Category:** Get Help\
**Tags:** password, email-template, signup, email-verification, verification-email\
**Created:** [May 13, 2021, 11:30am UTC](https://community.auth0.com/t/user-can-sign-in-before-email-confirmation/62730 "2021-05-13T11:30:36Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [May 13, 2021, 12:09pm UTC](https://community.auth0.com/t/user-can-sign-in-before-email-confirmation/62730/3 "2021-05-13T12:09:52Z")

</div>

Hi @monika.prakash,

Thanks for joining the Community!

By default, users can log in to an app without verifying their email, however, the user’s `email_verified` attribute will be false until they confirm their email address:

```auto
{
    "user_id": "auth0|507f1f77bcf86cd799439020",
    "email": "john.doe@gmail.com",
    "email_verified": false // <-- this attribute will be false until user verfies email
}

```

In order to require email verification, you can use a [post-login Action](https://auth0.com/docs/actions/triggers/post-login):

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

```

Until the user verifies their email, they will be redirected back to your app with an authorization error. The error message is passed as a query string param so that your app can display a user-friendly error:

```auto
http://exaample.com/?error=access_denied&error_description=Please%20verify%20your%20email%20before%20logging%20in.

```

Here is documentation on how to write an Action for your Auth0 tenant:

> **[Write Your First Action](https://auth0.com/docs/customize/actions/write-your-first-action)**
>
> Learn how to write an Action, which includes choosing a flow, creating an Action and configuring it, and binding it to the flow.

---

_[View the full topic](https://community.auth0.com/t/user-can-sign-in-before-email-confirmation/62730)._
