# How to redirect user to login when token is expire

**URL:** <https://community.auth0.com/t/how-to-redirect-user-to-login-when-token-is-expire/119959>\
**Category:** Get Help\
**Tags:** login-prompt-new-experience, login-experience\
**Created:** [November 1, 2023, 1:37pm UTC](https://community.auth0.com/t/how-to-redirect-user-to-login-when-token-is-expire/119959 "2023-11-01T13:37:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmdanish](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mmdanish/32/47292_2.png) [@mmdanish](https://community.auth0.com/u/mmdanish)\
**Post date:** [November 1, 2023, 1:37pm UTC](https://community.auth0.com/t/how-to-redirect-user-to-login-when-token-is-expire/119959/1 "2023-11-01T13:37:32Z")

</div>

hey Folks, I am working with Auth0 with nextjs i am facing an issue that if the token is expires i want the user to automatically redirect to login and he needs to login again how can i do that anyone??

---

<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:** [November 3, 2023, 4:27pm UTC](https://community.auth0.com/t/how-to-redirect-user-to-login-when-token-is-expire/119959/3 "2023-11-03T16:27:50Z")

</div>

Hi @mmdanish,

You can force users to reauthenticate when the token/session expires by configuring your Login Session Management settings for the **Inactivity timeout** and **Require log in after** settings.

See [Session Lifetime Limits](https://auth0.com/docs/manage-users/sessions/session-lifetime-limits).

Additionally, you may need to clear the user’s session by logging them out on the [Application Session.](https://auth0.com/docs/get-started/architecture-scenarios/sso-for-regular-web-apps/part-3#session-management). See our [Why Users Remain Login After the Inactivity Timeout](https://community.auth0.com/t/why-users-remain-login-after-the-inactivity-timeout/87161) FAQ for more details.

Please let me know if you have any questions about this.

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:** [November 17, 2023, 4:27pm UTC](https://community.auth0.com/t/how-to-redirect-user-to-login-when-token-is-expire/119959/4 "2023-11-17T16:27:53Z")

</div>

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