User Actions
Supported user actions:
- Refresh Login User Data
- Send Verification Code
- Register Account
- User Login
- Bind Contact Information
- Unbind Contact Information
- Reset Password
- Logout
- Deregister Account
This guide details the purpose and configuration of each user-related action to help you deliver a seamless and secure authentication experience.
Refresh Login User Data
Purpose:
Ensures the latest user data is reflected in the application after significant changes (e.g., binding/unbinding, password reset, or profile updates). This maintains data consistency between the client and server. Without refreshing, users may see outdated information until they reload or re-login.
How to Configure:
Add a button and bind the “Refresh Login User Data” action, or trigger it after relevant events (such as binding/unbinding or resetting a password).
Send Verification Code
Purpose:
Secure identity verification for sensitive operations such as sign in, sign up, reset password, bind/unbind account, and deregistration.
- Built-in service: Utilizes Momen’s built-in email functionality (SMS is currently unavailable).
- Bring your own channel: You can plug in third-party delivery (other SMS providers, email, etc.).
Bring-your-own delivery requires a project on Basic tier or higher.
How it works:
- Generation: When the “Send verification code” action runs, the system generates a 6-digit numeric code and stores the email or phone number, code, and scenario in the database (the table is not exposed).
- Delivery:
- System mode: Sent through the built-in channel.
- Custom mode: The system passes
send to,verification code, andscenariointo the designated Actionflow, which performs the send logic.
- Verification: When the user completes sign in, sign up, or another final action, the system compares the action inputs with the stored verification record; if they match, verification succeeds.
Configuration
Action settings
Configuration fields for the “Send Verification Code” action:
| Field | Type | Description |
|---|---|---|
| Delivery method | Enum (SMS / Email / Custom) | Choose SMS or Email to use Momen’s built-in delivery; choose Custom to use your own channel and then select Custom config below. |
| Custom config | Custom config | Required when delivery method is Custom; see the following steps. |
| Scenario | Enum (Register / Login / Reset / Bind account / Unbind account / Deregistration) | Must match the scenario used by later actions. |
| Send to | Text | Recipient. |
Custom delivery setup
If you use the Custom delivery method, complete these three steps in order:
Step 1: Create a send Actionflow
- Create an Actionflow and add three input parameters:
send to,verification code, andscenario. - Add send nodes—for example the built-in SMS (Twilio)—or send via API or another channel.
- Bind those inputs to the corresponding parameters on the send nodes.
Step 2: Add a custom configuration
- Go to Settings → Verification code and add a custom configuration.
- Fill in the basics:
- Name: A label for you (e.g. Twilio SMS).
- Type: Choose SMS or Email.
- Actionflow for sending verification code: Select the Actionflow from Step 1.
- Actionflow inputs: Bind the action’s inputs (under Constant in the data binding menu you can find
Send to,Verification code, andScenario) to the matching Actionflow inputs.
Step 3: Use the custom configuration
In the Send Verification Code action, set Custom config to the configuration you added. Codes will be delivered through your Actionflow.
Register Account
Purpose:
Allows users to create an account by providing information such as username, email, phone, and password. Registration may include verification for authenticity. Momen supports registration via username, phone, or email.
How to Configure:
Add input components and a button. Configure a registration action for the button. Bind the input values (username, phone, email, verification code, password) to the action.
Note:
Upon successful registration, Momen stores credentials in a secure, developer-invisible table and creates a user record in the default account table (“current user data”). The record ID is linked to registration data. It is recommended to configure a “Show Toast” action to notify users of registration success or failure.
User Login
Purpose:
Allows registered users to access their accounts using username/password or other supported methods (email, phone, verification code). Momen supports username login, phone verification login, phone & password login, and email login.
How to Configure:
Add input components and a button. Configure a login action for the button. Bind the input values (username, phone, email, verification code, password) to the action.
Note:
It is recommended to configure a “Show Prompt” action for login success/failure, or a navigation action to redirect users after login.
Bind Contact Information
Purpose:
Enables users to add a phone number or email to their account for enhanced security and easier recovery. After binding, the contact info is updated in the user’s account record.
How to Configure:
Add input components and a button. Configure a binding action. Bind the email/phone and verification code fields to the action.
Note:
When requesting a verification code for binding, set the code type to “Bind account”.
Unbind Contact Information
Purpose:
Allows users to remove a previously bound phone number or email, typically when changing contact info. After unbinding, the contact info is cleared from the user’s account record.
How to Configure:
Add a button and input for the verification code. Configure an unbinding action and bind the code field.
Note:
When requesting a verification code for unbinding, set the code type to “Unbind account”.
Reset Password
Purpose:
Allows users to reset a forgotten password using their registered phone or email. This process requires identity verification via code before setting a new password.
How to Configure:
Add input components (phone/email, new password, verification code) and a button. Configure a password reset action and bind the fields.
Logout
Purpose:
Ends the current user session and logs the user out. Closing the browser does not log out the user; this action ensures privacy and security.
How to Configure:
Add a logout button. Optionally, combine with actions to refresh user data, recalculate data, or update the UI. Logout only affects the session and does not modify database records.
Deregister Account
Purpose:
Allows users to permanently delete their account and all associated data. This irreversible action requires confirmation and may involve multiple steps for security. Momen supports account deletion via verification code or password.
How to Configure:
Add input components (verification code or password) and a button. Configure an account deletion action and bind the fields. For code-based deletion, choose the appropriate sending method (SMS or email).
Note:
When requesting a verification code for deregistration, set the code type to “Deregistration”.