Link Search Menu Expand Document

Login User

For a User to perform Login in your application, you will need to create a new Login Datasource.

Create User Login Datasource

  1. Create a new Login Screen.
  2. Add two Text Fields for email and password.
  3. Press the Datasource button, and then the + Create datasource button.
  4. Select the Kodika Server tab.
  5. Select the User Data Type.
  6. Select Login User.
  7. Bind the Email and Password parameters with the respective Text Fields.
  8. Connect at least the parameters of the On Success response.
  9. Press Save.
  10. Close the Datasource popup.
  11. Add a Button and change its title to Login.
  12. Create a Start a Datasource Request Event Action in the On Click Event of the Login Button and select the newly created Datasource.

Request Parameters

Email

The email the user will try to login with.

Validations:

  • When Invalid Email response will be called, if the email is not in a valid email address format.

Password

The password the user will try to login with.

Validations:

Responses

Note: If any of the validations failed, the On Success response is not called, and only the respective failure response is called.

On Success

Called when the login of the user is successful. User will be automatically logged in and set as Current User.

Parameters:

  • User: The logged in user.

On Error

Called when there is an unknown error that is not handled by the other responses.

Parameters:

  • Error: A text with an error message.

When Offline

Called when the user has no Internet connection.

Parameters:

  • Error: A text with an error message.

When Invalid Email

Called when email parameter is a wrong formatted email address.

Parameters:

  • Error: A text with an error message.

When Wrong Password

Called when password is not correct for the provided email.

Parameters:

  • Error: A text with an error message.

Datasource automation

We would suggest setting the Datasource Spinner to ON and Auto start when Screen First Loads to OFF for this request, as we want to show a spinner during the request and execute the request only when the Button is pressed.