# index

## Redirect Page Overview

The purpose of this page is just to redirect the user to whatever page they need to be going to. The reason why it's blank (instead of using a page like [home](https://docs.airdev.co/canvas/2.0.0-1/using-the-template/reference/pages/home-page)) is that a blank page ensures a faster redirect, so users don't see a flash of content before they are redirected.

## Key Workflows

There are four redirect rules on the index page:

![](https://2550662654-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LYJWnUT3lUFQk1K9BCK%2F-Ls3QQor-a39iHNXy0B4%2F-Ls3V_iDOwHq52gipBKc%2FScreen%20Shot%202019-10-25%20at%201.01.12%20PM.png?alt=media\&token=f4039d8e-6dda-4939-b84b-f9ce0c14d1b0)

1. When `User is logged in` AND `Current user's Date completed signup is empty` **->** Go to page `login` and add URL parameter `m=signup`
   * If the user did not complete the sign up process (e.g., verify his email if App owner requires email verification during sign up), then they will be redirected back to the [login](https://docs.airdev.co/canvas/2.0.0-1/using-the-template/reference/pages/login-pages) page.
2. When `User is logged in` AND `Current user's Owner? is "no"` AND `Get stay from page url is not empty` OR `Current user's Date completed signup is not empty` **->** Go to page `home`
   * This means that if a user is a not an Owner or if they are redirected to this page from a different page in the app (by clicking on the logo), they should be taken to the homepage
3. When `User is logged in` and `Current user's Owner? is "yes"` AND`Get stay from page url is empty` **->** Go to page `owner`
   * This means that if the user is an Owner user and they're not intending to visit the homepage they should be taken to the Owner's Portal
4. When `User is logged out` **->** Go to page `home`
   * This means that logged out users should be taken to the homepage

***NOTE: You should add any additional redirect rules to this index page, since every user who is logged in will be taken to it before being redirected to another page.***

On other pages (like [home](https://docs.airdev.co/canvas/2.0.0-1/using-the-template/reference/pages/home-page) and [login](https://docs.airdev.co/canvas/2.0.0-1/using-the-template/reference/pages/login-pages)) the app will redirect the user to the `index` page whenever they log in, so that they can be redirected to an appropriate page afterwards. Think of this page as a traffic cop - when your users log in or log out, they pass through it to be directed to the right page.
