Skip to main content

Common Auth Actions

Here's a list of common authentication actions:

Logout [Action]

This action enables users to securely log out of their account and clear their session data from the app, which ensures that their account remains safe and secure.

Follow the steps below to add this action:

  1. Select the widget (e.g., Button) on which you want to add the action.
  2. Select Actions from the properties panel (the right menu), If it's the first action, click + Add Action button. Otherwise, click the "+" button below the previous action tile (inside Action Flow Editor) and select Add Action.
  3. Search and select the Logout (under Backend/Database > Firebase Authentication) action.

logout

Reset Password [Action]

Resetting password allows users to change their password by sending them a password reset link to their email address.

On click of the 'Send Link' button, add the 'Reset Password' action, which sends the password reset link to the given email address. Here are the steps:

  1. Select the widget (e.g., Button) on which you want to add the action.

  2. Select Actions from the properties panel (the right menu) and select Add Action.

  3. Search and select the Reset Password (under Backend/Database > Firebase Authentication) action.

  4. Set the Email Field dropdown to the widget name that accepts email (e.g., TextFieldEmail).

password reset action

Update Email [Action]

This action allows users to change their registered email address linked to their user profile, thus ensuring their account details are up-to-date.

This is helpful in scenarios where a user may have changed their primary email address or entered an incorrect one during initial registration. Also, if users lose access to their original email or forget their login credentials, being able to update their email addresses can assist in resetting passwords or recovering account access.

Follow the steps below to add this action to any widget.

  1. Select the Widget (e.g., Container, Button, etc.) on which you want to add the action.
  2. Select Actions from the properties panel (the right menu), If it's the first action, click + Add Action button. Otherwise, click the "+" button below the previous action tile (inside Action Flow Editor) and select Add Action.
  3. Search and select the Update Email (under Backend/Database > Firebase Authentication) action.
  4. As a best practice, it's also recommended to send the email verification link to the new email (using the e-mail verification action) followed by this action.

adding-update-email-action

Delete User [Action]

Using this action, you can delete the user account created using the Firebase authentication. Additionally, you can also set up to delete all data associated with that user.

Follow the steps below to add this action to any widget.

  1. Select the Widget (e.g., Container, Button, etc.) on which you want to add the action.

  2. Select Actions from the properties panel (the right menu), If it's the first action, click + Add Action button. Otherwise, click the "+" button below the previous action tile (inside Action Flow Editor) and select Add Action.

  3. Search and select the Delete User (under Backend/Database > Firebase Authentication) action.

  4. As a best practice, it's also recommended to log out the user (using the logout action) following this action.

    adding-delete-action

  5. To delete all records and data associated with that user's account:

    1. Navigate to the Firestore (from the Navigation Menu) > switch to Firestore Settings > Firestore Rules.
    2. Identify the collection from which you want to delete the user's data and ensure the Delete rule is set to Tagged Users. This will open the 'Tag Users' popup; here you can select the field that contains the document reference. See how to setup a rule.
    3. Tick the checkbox.
    4. See the Delete User References section and click on Preview to verify the generated rule.
    5. Click the Deploy button.

FAQs

While adding Delete User [Action], I can't see or select field in 'Tag Users' popup

If you can't see or select the field containing the user reference, ensure that you have enabled the 'Create User Document' option in the Create Account action. Enabling this option ensures that the 'users' collection is properly set up and its reference can be accessed in the 'Tag Users' popup.