# How to handle access denied response

**URL:** <https://community.auth0.com/t/how-to-handle-access-denied-response/136668>\
**Category:** Get Help\
**Tags:** login-prompt-new-experience, login-experience\
**Created:** [June 19, 2024, 7:12pm UTC](https://community.auth0.com/t/how-to-handle-access-denied-response/136668 "2024-06-19T19:12:35Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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:** [June 28, 2024, 9:59pm UTC](https://community.auth0.com/t/how-to-handle-access-denied-response/136668/3 "2024-06-28T21:59:50Z")

</div>

Hi @gabor.ottlik.hun,

When you use the `api.access.deny()` method, it will deny users from logging in, but their session will remain intact. So, in subsequent login attempts, the user will continuously be sent to the error page (`http://localhost:3000/api/auth/callback?error=access_denied&error_description=access%20denied.&state=eyJyZXR1cm5UbyI6Imh0dHA6Ly9sb2NhbGhvc3Q6MzAwMCJ9`) until the user logs out.

That said, you will need to log the user out whenever they have been denied access to kill the session. This way, they can try logging in again with another user. To do so, please redirect your users to the `/v2/logout` endpoint.

See [this knowledge solution](https://community.auth0.com/t/cannot-get-back-to-login-screen-after-getting-denied-by-post-login-action/115808) as a reference.

Thanks,  
Rueben

---

_[View the full topic](https://community.auth0.com/t/how-to-handle-access-denied-response/136668)._
