Project AuthenticationVerification Services
Project Authentication

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;
}
FieldDescription
verificationSettingsGeneral options for all verifications. You can change the verification mode (test/live) here.
passwordResetByEmailConfigures email-based password reset functionality. Includes template, expiration, and verification strategy (link or code).
passwordResetByMobileConfigures SMS-based password reset functionality. Requires active mobile field in user schema.
email2FactorEnables and configures two-factor authentication via email. Typically used during login or sensitive actions.
mobile2FactorEnables and configures two-factor authentication via SMS. Requires mobile phone to be active in user schema.
emailVerificationConfigures email verification flow, including delivery method (link or code), expiration, and resend timing.
mobileVerificationConfigures 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;
}
FieldDescription
verificationModeSet 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",
};
EnumDescription
testModeIn test mode, secret code is also sent to the frontend in the response of the /start request.
liveModeIn 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;
}
FieldDescription
passwordResetByEmailIsActiveActivates or deactivates the password reset by email feature.
configurationThe 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;
}
FieldDescription
resendTimeWindowInterval in seconds before the user can request another verification message.
expireTimeWindowDuration in seconds after which the verification link/code expires.
verificationTypeSpecifies whether verification is triggered by clicking a link or entering a code.
verificationTemplateAn 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",
};
EnumDescription
byLinkSends a clickable verification link via email or SMS. The user verifies by clicking the link.
byCodeSends 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;
}
FieldDescription
passwordResetByMobileIsActiveActivates or deactivates the password reset by mobile feature.
configurationThe 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;
}
FieldDescription
email2FactorIsActiveEnables or disables two-factor authentication via email.
configurationThe 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;
}
FieldDescription
mobile2FactorIsActiveEnables or disables two-factor authentication via mobile.
configurationThe 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;
}
FieldDescription
emailVerificationIsActiveEnables or disables email verification.
configurationThe 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;
}
FieldDescription
mobileVerificationIsActiveEnables or disables mobile verification.
configurationThe configuration object for mobile verification. Leave it null if mobileVerificationIsActive is false.
Was this page helpful?
Built with Documentation.AI

Last updated today