# Logout via onExecutePostLogin action

**URL:** <https://community.auth0.com/t/logout-via-onexecutepostlogin-action/103002>\
**Category:** Get Help\
**Tags:** sessions, logout\
**Created:** [March 21, 2023, 3:33pm UTC](https://community.auth0.com/t/logout-via-onexecutepostlogin-action/103002 "2023-03-21T15:33:31Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [March 29, 2023, 10:39pm UTC](https://community.auth0.com/t/logout-via-onexecutepostlogin-action/103002/5 "2023-03-29T22:39:16Z")

</div>

Hey @torefindsen sorry for the delayed response here - You won’t be able to log a user out from within a post login action as the user hasn’t successfully logged in until the action is complete.

This is the standard way to approach requiring users to verify their email prior to logging in:

> [@User can sign in before email confirmation](https://community.auth0.com/t/user-can-sign-in-before-email-confirmation/62730/3):
>
> 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: { "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): exports.onExecutePostL…

Users won’t be able to fully log in to your app until they’ve successfully verified their email.

Hope this helps!

---

_[View the full topic](https://community.auth0.com/t/logout-via-onexecutepostlogin-action/103002)._
