# Invalidate session after unsuccessfull login

**URL:** <https://community.auth0.com/t/invalidate-session-after-unsuccessfull-login/120229>\
**Category:** Get Help\
**Tags:** new-universal-login-experience, login-experience\
**Created:** [November 4, 2023, 9:47am UTC](https://community.auth0.com/t/invalidate-session-after-unsuccessfull-login/120229 "2023-11-04T09:47:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gigivadachkoria](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gigivadachkoria/32/52135_2.png) [@gigivadachkoria](https://community.auth0.com/u/gigivadachkoria)\
**Post date:** [November 4, 2023, 9:47am UTC](https://community.auth0.com/t/invalidate-session-after-unsuccessfull-login/120229/1 "2023-11-04T09:47:55Z")

</div>

I am using action flows to restrict users signing in if email is verified, problem is on the frontend part when i go back to login page after unsuccessfull attempt(without verified email) it still tries to login with same credentials, how can i invalidate or make auth0 “forget” that session, im using auth0 sdk with next

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [November 30, 2023, 7:53pm UTC](https://community.auth0.com/t/invalidate-session-after-unsuccessfull-login/120229/3 "2023-11-30T19:53:22Z")

</div>

Hi @gigivadachkoria

Welcome back to the Auth0 Community!

To resolve the issue where a user’s session persists even after a failed login attempt due to an unverified email in Auth0, you must ensure the session is cleared correctly. To achieve this, your frontend code needs to check for errors during login and logout user when the error occurs.

Thanks  
Dawid

---

<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:** [December 14, 2023, 7:53pm UTC](https://community.auth0.com/t/invalidate-session-after-unsuccessfull-login/120229/4 "2023-12-14T19:53:52Z")

</div>

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