The registration screen and login screen must be linked together so that the app functions properly and restricts use to those who are not properly logged in. 

Features

Linking a registration screen and login screen offers the following features:

  1. Users cannot view all screens without logging in
  2. App creator can prevent people who do not have access from logging in
  3. The Login screen and the Registration screen use the same data source

Get Started

To link the registration screen and the login screen you’ll need to:

  1.  Setup a registration screen
  2. Setup a login screen
  3. Link the login screen to the registration screen
  4. Link the registration screen to login
  5. Setup and test the app security rule

1. Setup registration screen

 Refer to the first tutorial for directions on how to setup a registration screen.

2. Setup login screen

 Refer to the second tutorial for directions on how to setup a login screen.

3. Link login screen to registration screen

Although the registration screen and login screen have been setup, they won’t work together until they have been linked and security rules have been put in place. 

You should have already done this in step 4 of the second tutorial

4. Link registration screen to login

  1.  Go to the registration screen
  2. Click on the form to open up the settings
  3. In the settings scroll all the way to the bottom
  4. There is an option that says After the form has been submitted.
  5. Choose the option “Take the user to another screen” and select the login screen from the drop-down.
  6. The settings should look like this:


  7. Click “Save and Close”
    1. Now when they click submit on the registration screen, users will automatically be taken to the login screen.
    2. Now it’s important that the registration screen and the login screen use the same data source. At the moment they are using two different ones.
  8. Go to the login screen settings and select the same data source that you used for the registration screen.
  9. Under select the email field, choose “Email input”.
  10. Under select the password field, choose “Password input”.
  11. Click “Save and Close”.


5. Setup and test app security rule

  1. Go to the app settings by clicking on the app settings button on the far right. (See the arrow in the image below).
  2. Click on the tab at the top that says “App Security”.


  3. Click on the button that says “Add new rule”
  4. Choose the options displayed in this image:


    1. This means users will only be able to access the Login screen and the Registration screen unless they are logged in already.
  5. Finally where it says if the required condition above is not met, which screen should the user be redirected to? Under “Select a screen” choose “Login”.
    1. This means that whenever a user is not logged in, they will be taken directly to the login screen.
  6. Now the form should look like this:


  7. Click the blue “Save” button.
  8. To test the rule go to preview mode.
  9. Click on the “Enable Security” button (next to the arrow).


  10. If you are logged in, click the reset preview button.
  11. Now you can test by trying to move to the other screens. With the security enabled, the app should prevent you from viewing your other screens and should revert back to the login.