Sign UP ~ IN
Sign Up~In showcases how to implement a simple Sing up then Login with username and password.
Username and Password are stored in a Cloud Collection.
Install LOGIN Tutorial
How the Sing In Works
This implementation is very simple.
All the testing is done when the user submit the form which capture the username and password.
A Cloud Collection named "username passwords" containing demo username and password is installed with the app.
When the user clicks submit the variable "userName" captured by the Form Input block as a username iis checked against the Username list of the Cloud Collection using a 'Go to Matching Record'
To review the Actions executed when the user select the Form Input Submit, go the Form Input Block, select the contextual menu "..." and choose the list of Event to display the Event associated with the Form Input Block:
When you click the 'Submit' Event the associated Actions will be shown:
The variable "userName" is search, if found the variable "foundUsername" will be set to "true" otherwise to "false"
After that, we have 3 conditional Switch Views to validate the password.
1. The first conditional Switches to the the 'Success Login' view if and only if the password field of the current record matches the capture variable in the form "passWord".
That ensure that only if the captured password matches the one stored in the Cloud Collection the switch will be effective.
The other 2 conditional Switch to Another View direct the user to the 'Failed Login' view.
They respectively test the 2 remaining conditions:
1. User exist but password doesn't match.
We Switch View to Login Failed View if the Password field from the Cloud Collection does not match the entered Password.
2. User was wrong in the first place:
The foundUsername variable is set to false i.e. no user was found in the first place
Note: We use 2 different Switch view because we have 2 conditions to test and we can only enter one condition per Switch View Action.
For the Go to Matching record to work, the feeds needs to be initialized.
This is done by running Dependencies on ANY block of the displayed View.
Running Dependencies will essentially load the Data Source and get it ready for use.
Here we use the Canvas.
Simply select ANY field of the Data Source you want to initialize and it will be ready for user.
1. This implementation only work if each username is UNIQUE.
This app doesn't cover the creation of a username / password.