VerificationServices
Defines user-related verification features such as password resets, two-factor authentication, and contact verification in Mindbricks, including configuration options for email and mobile flows.
MPO Version: 1.3.0
Defines user-related verification features such as password resets and two-factor authentication (2FA). Mindbricks generates backend support code for these features automatically, based on this configuration, as part of the user service module.
interface VerificationServices = {
verificationSettings : VerificationSettings;
passwordResetByEmail : PasswordResetByEmail;
passwordResetByMobile : PasswordResetByMobile;
email2Factor : Email2Factor;
mobile2Factor : Mobile2Factor;
emailVerification : EmailVerification;
mobileVerification : MobileVerification;
}
| Field | Description |
|---|---|
| verificationSettings | General options for all verifications. You can change the verification mode (test/live) here. |
| passwordResetByEmail | Configures email-based password reset functionality. Includes template, expiration, and verification strategy (link or code). |
| passwordResetByMobile | Configures SMS-based password reset functionality. Requires active mobile field in user schema. |
| email2Factor | Enables and configures two-factor authentication via email. Typically used during login or sensitive actions. |
| mobile2Factor | Enables and configures two-factor authentication via SMS. Requires mobile phone to be active in user schema. |
| emailVerification | Configures email verification flow, including delivery method (link or code), expiration, and resend timing. |
| mobileVerification | Configures mobile verification flow via SMS, with support for link-based or code-based confirmation. |
VerificationSettings
MPO Version: 1.3.0
General options for all verifications. You can change the verification mode (test/live) here.
interface VerificationSettings = {
verificationMode : VerificationMode;
}
| Field | Description |
|---|---|
| verificationMode | Set the mode of the verification here. In test mode, the secret code is sent to the frontend (as well as email or text), for user to be able to input it to the code page. In live mode the message is sent only to the email address or mobile phone number. The default value is testMode, don't forget to change it to liveMode after you defined the email/sms provider settings in the production environment. |
VerificationMode
An enum value to define the verification mode of the verification services to be able to manage the development process and the production process.
const VerificationMode = {
testMode: "testMode",
liveMode: "liveMode",
};
| Enum | Description |
|---|---|
| testMode | In test mode, secret code is also sent to the frontend in the response of the /start request. |
| liveMode | In live mode, secret code is only sent to the user's email or phone number. |
PasswordResetByEmail
MPO Version: 1.3.0
Configuration for enabling password reset via email. Defines whether the feature is active, how long the reset token remains valid, and how frequently a user can request resending the verification message.
interface PasswordResetByEmail = {
passwordResetByEmailIsActive : Boolean;
configuration : VerificationConfig;
}
| Field | Description |
|---|---|
| passwordResetByEmailIsActive | Activates or deactivates the password reset by email feature. |
| configuration | The configuration object for password reset by email. Leave it null if passwordResetByEmailIsActive is false. |
VerificationConfig
MPO Version: 1.3.0
Defines the configuration for verification flows, including password resets and two-factor authentication. This object is used when the respective feature is active.
interface VerificationConfig = {
resendTimeWindow : Integer;
expireTimeWindow : Integer;
verificationType : VerificationType;
verificationTemplate : Text;
}
| Field | Description |
|---|---|
| resendTimeWindow | Interval in seconds before the user can request another verification message. |
| expireTimeWindow | Duration in seconds after which the verification link/code expires. |
| verificationType | Specifies whether verification is triggered by clicking a link or entering a code. |
| verificationTemplate | An ejs template source to render the message that will be sent to the user for the verification process. The template will be rendered with the verification data that includes the user object. |
VerificationType
Defines the method used for user verification flows such as password reset, two-factor authentication, or account confirmation. This enum helps determine whether the user interacts with a clickable link or a manually entered code.
const VerificationType = {
byLink: "byLink",
byCode: "byCode",
};
| Enum | Description |
|---|---|
| byLink | Sends a clickable verification link via email or SMS. The user verifies by clicking the link. |
| byCode | Sends a numerical or alphanumerical code. The user verifies by entering the code into the application interface. |
PasswordResetByMobile
MPO Version: 1.3.0
Configuration for enabling password reset via mobile. Specifies token expiration time, resend intervals, and verification type (link or code).
interface PasswordResetByMobile = {
passwordResetByMobileIsActive : Boolean;
configuration : VerificationConfig;
}
| Field | Description |
|---|---|
| passwordResetByMobileIsActive | Activates or deactivates the password reset by mobile feature. |
| configuration | The configuration object for password reset by mobile. Leave it null if passwordResetByMobileIsActive is false. |
Email2Factor
MPO Version: 1.3.0
Configuration for email-based two-factor authentication. Activates the feature and defines verification expiration and resend rules.
interface Email2Factor = {
email2FactorIsActive : Boolean;
configuration : VerificationConfig;
}
| Field | Description |
|---|---|
| email2FactorIsActive | Enables or disables two-factor authentication via email. |
| configuration | The configuration object for email-based two-factor authentication. Leave it null if email2FactorIsActive is false. |
Mobile2Factor
MPO Version: 1.3.0
Configuration for mobile-based two-factor authentication. Allows setup of token validity duration, resend rate, and type of verification mechanism.
interface Mobile2Factor = {
mobile2FactorIsActive : Boolean;
configuration : VerificationConfig;
}
| Field | Description |
|---|---|
| mobile2FactorIsActive | Enables or disables two-factor authentication via mobile. |
| configuration | The configuration object for mobile-based two-factor authentication. Leave it null if mobile2FactorIsActive is false. |
EmailVerification
MPO Version: 1.3.0
Defines the settings for verifying a user's email address. Includes token expiration duration, resend interval, and whether verification is handled via link or code.
interface EmailVerification = {
emailVerificationIsActive : Boolean;
configuration : VerificationConfig;
}
| Field | Description |
|---|---|
| emailVerificationIsActive | Enables or disables email verification. |
| configuration | The configuration object for email verification. Leave it null if emailVerificationIsActive is false. |
MobileVerification
MPO Version: 1.3.0
Defines the settings for verifying a user's mobile number. Includes resend interval, expiration period, and verification method (link or code).
interface MobileVerification = {
mobileVerificationIsActive : Boolean;
configuration : VerificationConfig;
}
| Field | Description |
|---|---|
| mobileVerificationIsActive | Enables or disables mobile verification. |
| configuration | The configuration object for mobile verification. Leave it null if mobileVerificationIsActive is false. |
Last updated today