# Login linked to Members Area

**URL:** <https://forum.wixstudio.com/t/login-linked-to-members-area/52808>\
**Category:** Ask the community\
**Tags:** wix-members-area, code\
**Created:** [October 1, 2023, 5:15pm UTC](https://forum.wixstudio.com/t/login-linked-to-members-area/52808 "2023-10-01T17:15:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![user534](https://avatars.discourse-cdn.com/v4/letter/u/7ba0ec/32.png) [@user534](https://forum.wixstudio.com/u/user534)\
**Post date:** [October 1, 2023, 5:15pm UTC](https://forum.wixstudio.com/t/login-linked-to-members-area/52808/1 "2023-10-01T17:15:20Z")

</div>

Hello, everyone.  
And immediately thank you to those who would like to respond.  
Problem probably very simple for most of you, but not for me who only knows the basics of html.  
What I need is that when a member of the private area logs in, he/she is redirected to the private “memebers area” page.  
From Wix they told me that I have to use code because otherwise after the login the member remains on the page where they logged in from.  
I have already searched the forum and tried but no…I can’t  
Thanks again for giving me practical examples.  
Greetings to all.

---

<div class="post-metadata">

**Author:** ![Pratham](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/pratham/32/119586_2.png) [@Pratham](https://forum.wixstudio.com/u/Pratham)\
**Post date:** [October 2, 2023, 10:05pm UTC](https://forum.wixstudio.com/t/login-linked-to-members-area/52808/2 "2023-10-02T22:05:08Z")

</div>

Hi there, follow these steps below and you are good to go:

1. Turn on **Dev Mode**.

2. From the **Page Code** panel on the left, select _masterPage.js_.

3. Simply replace the existing code with the one provided below:

```javascript
import {authentication} from 'wix-members-frontend';
import wixLocationFrontend from 'wix-location-frontend';

const redirecturl = "https://google.com"

$w.onReady(function () {
    authentication.onLogin(async (member) => {
    wixLocationFrontend.to(redirecturl)
    });
});

```

1. Just replace the Google url with your own members area url and that’s it! (:
