# Show Popup/Alert Before Logging Out With GetAccesTokenSilently

**URL:** <https://community.auth0.com/t/show-popup-alert-before-logging-out-with-getaccestokensilently/93619>\
**Category:** Get Help\
**Tags:** jwt, react, access-token, auth0\
**Created:** [November 3, 2022, 8:07am UTC](https://community.auth0.com/t/show-popup-alert-before-logging-out-with-getaccestokensilently/93619 "2022-11-03T08:07:17Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![ritiwari369](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ritiwari369/32/36504_2.png) [@ritiwari369](https://community.auth0.com/u/ritiwari369)\
**Post date:** [November 3, 2022, 9:41am UTC](https://community.auth0.com/t/show-popup-alert-before-logging-out-with-getaccestokensilently/93619/3 "2022-11-03T09:41:08Z")

</div>

Got the solution from another thread [Check session without extending it](https://community.auth0.com/t/check-session-without-extending-it/58569). We can do like this:-

```auto
getAccessTokenSilently()
      .then((token) => {
        console.log(token);
      })
      .catch((e) => {
        if (e.error === "login_required")
          alert("logging out");
      });

```

Thanks 🙂

---

_[View the full topic](https://community.auth0.com/t/show-popup-alert-before-logging-out-with-getaccestokensilently/93619)._
