# Redirect after Logout

**URL:** <https://forum.wixstudio.com/t/redirect-after-logout/25211>\
**Category:** Ask the community\
**Tags:** question, wix-members-area, code\
**Created:** [April 22, 2020, 3:34pm UTC](https://forum.wixstudio.com/t/redirect-after-logout/25211 "2020-04-22T15:34:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ispear](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/ispear/32/15511_2.png) [@ispear](https://forum.wixstudio.com/u/ispear)\
**Post date:** [April 22, 2020, 3:34pm UTC](https://forum.wixstudio.com/t/redirect-after-logout/25211/1 "2020-04-22T15:34:37Z")

</div>

I’m trying to adjust the Logout process. When a logged-in user logs out from a members only page, the Login page pops up. How can I adjust this so instead the user is logged out and then redirected to the home page. Thanks for the help!

---

<div class="post-metadata">

**Author:** ![J.D](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/j.d/32/7312_2.png) [@J.D](https://forum.wixstudio.com/u/J.D)\
**Post date:** [April 22, 2020, 4:05pm UTC](https://forum.wixstudio.com/t/redirect-after-logout/25211/2 "2020-04-22T16:05:23Z")

</div>

Create your own logout button and then you can control it by code:

```javascript
import wixLocation from 'wix-location';
import wixUsers from 'wix-users';
//....
$w.onReady(() => {
$w("#logoutButton").onClick(() => {
Promise.all([wixUsers.logout(), wixLocation.to("/home")]);
})
})

```
