# After I click logout on nextjs app it login again

**URL:** <https://community.auth0.com/t/after-i-click-logout-on-nextjs-app-it-login-again/117179>\
**Category:** Get Help\
**Tags:** new-universal-login-experience, login-experience\
**Created:** [September 26, 2023, 4:38pm UTC](https://community.auth0.com/t/after-i-click-logout-on-nextjs-app-it-login-again/117179 "2023-09-26T16:38:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![steveng](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/steveng/32/51177_2.png) [@steveng](https://community.auth0.com/u/steveng)\
**Post date:** [September 26, 2023, 4:38pm UTC](https://community.auth0.com/t/after-i-click-logout-on-nextjs-app-it-login-again/117179/1 "2023-09-26T16:38:20Z")

</div>

Hello, can someone give me updated reference on how to solve this problem in NextJs

I have logout link to `/api/auth/logout` (Given that I setup the api/auth/[auth0]/route.js)

```auto
   <Button
            href="/api/auth/logout"
            variant="outlined"
            color="primary"
            component={Link}
            fullWidth
          >
            Logout
          </Button>

```

But when I clicked that there is an error on the console that I cannot clearly see because it reloads in split second and login again like nothing happens.

I am a noob developer so very sorry about this. Please help, if this was solved please comment down the references.

Thanks!

---

<div class="post-metadata">

**Author:** ![steveng](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/steveng/32/51177_2.png) [@steveng](https://community.auth0.com/u/steveng)\
**Post date:** [September 26, 2023, 6:46pm UTC](https://community.auth0.com/t/after-i-click-logout-on-nextjs-app-it-login-again/117179/2 "2023-09-26T18:46:10Z")

</div>

Solved temporarily by using onClick function instead of href. really weird.

---

<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:** [October 10, 2023, 6:46pm UTC](https://community.auth0.com/t/after-i-click-logout-on-nextjs-app-it-login-again/117179/3 "2023-10-10T18:46:19Z")

</div>

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