---
title: "Redirecting Customers to their Home Location"
slug: "redirecting-customers-to-their-home-location"
updated: 2023-07-26T15:44:41Z
published: 2023-07-26T15:44:41Z
canonical: "help.nexudus.com/redirecting-customers-to-their-home-location"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://help.nexudus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Redirecting customers to their home location when they try to log in via the network

This customization snippet lets you automatically redirect customers to their home location whenever they try to log in to your Members Portal via your network location.

          This customization only works if you're using [version 4](/v3/docs/finding-your-members-portal-version) of the Members Portal.

          

---

1. Log in to [dashboard.nexudus.com](https://dashboard.nexudus.com/) if you aren't already.
2. Click [**Settings > Web template editor**](https://dashboard.nexudus.com/settings/editor/templates).
3. Click on the **Pages & components** folder.
4. Click **Add file**.
5. Name your file **redirection.jsx** and press **Enter** on your keyboard.
6. Add the following snippet to your file.

```
import React, { Component } from 'react';
import { inject, observer } from 'mobx-react';
import { withTranslation } from 'react-i18next';
import DefaultLayout from 'ui/layouts/DefaultLayout';
import Breadcrumbs from 'ui/components/Breadcrumbs';
import LoadingLayout from 'ui/layouts/LoadingLayout';

 
@withTranslation()
@inject('appStore', 'authStore')
@observer
class CustomPage extends Component {
  componentDidMount() {
      const { authStore, appStore } = this.props;
      if(authStore.isLoggedIn){
          setTimeout(async () => {
              const me = await authStore.loadMe();
              const homeSpace = appStore.businesses.find(b => b.Id == authStore.customer.HomeSpaceId);
              if(homeSpace){
                  window.location = homeSpace.HomeUrl + `/login?t=${me.AccessToken}`;
              }    
             
          }, 2000)
      } else {
          window.location = `/login?redirectUrl=${encodeURIComponent('/pages/sso')}`
      }
  }
 
  render() {
      return (
          <LoadingLayout />
      );
  }
}

 
export default CustomPage;
```

1. Click the **Save** button.

---

All set! We recommend testing the customization by trying to log in from the network using a test customer account.
