# Correct way to return to hosted login (soft logout)

**URL:** <https://community.auth0.com/t/correct-way-to-return-to-hosted-login-soft-logout/7302>\
**Category:** Get Help\
**Tags:** hosted-login-page, logout\
**Created:** [June 28, 2017, 3:32pm UTC](https://community.auth0.com/t/correct-way-to-return-to-hosted-login-soft-logout/7302 "2017-06-28T15:32:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jontycurtis](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jontycurtis/32/7771_2.png) [@jontycurtis](https://community.auth0.com/u/jontycurtis)\
**Post date:** [June 28, 2017, 3:32pm UTC](https://community.auth0.com/t/correct-way-to-return-to-hosted-login-soft-logout/7302/1 "2017-06-28T15:32:01Z")

</div>

My SPA app requires users are always authenticated. I have a logout button in the app that I want to return users to the hosted login page.

I thought the correct way would be simply to call auth0.authorize() again. This does return to the hosted login page, but there is an issue that when you click to login again, you get sent back to the hosted login. If you click again, it works. So, you always have to login twice after being sent back to the hosted login via auth0.authorize().

I am using the javascript SDK login sample code, just added auth0.authorize at the end of the logout function.

---

<div class="post-metadata">

**Author:** ![jontycurtis](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jontycurtis/32/7771_2.png) [@jontycurtis](https://community.auth0.com/u/jontycurtis)\
**Post date:** [June 28, 2017, 5:16pm UTC](https://community.auth0.com/t/correct-way-to-return-to-hosted-login-soft-logout/7302/2 "2017-06-28T17:16:02Z")

</div>

I resolved this. Was an issue with my isAuthenticated check. I was running the isAuthenticated check on the callback page which was then calling auth0.authorise() again. Whitelisted the callback page from the auth check.

---

<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:** [March 2, 2018, 5:55am UTC](https://community.auth0.com/t/correct-way-to-return-to-hosted-login-soft-logout/7302/3 "2018-03-02T05:55:01Z")

</div>


