Every step in requiredSetupSteps and the login flow can be enabled or disabled
without removing it from the configuration. This is useful for feature flags, A/B
testing, or gradual rollouts.
Add 'enabled' => false to the driver definition:
'drivers' => [
'smsOtp' => [
'enabled' => false, // step is skipped entirely
'options' => ['ttl' => 300],
],
],When a step is disabled:
VerificationService::getDriver('smsOtp')returnsnull.VerificationService::getSteps()skips it.- It is never listed in
VerificationResult::pendingSteps(). - Users are not redirected to it.
To skip 2FA on every login, disable the plugin entirely via the master toggle:
// config/verification.php
'enabled' => false,Or disable only the OTP driver the user enrolled in:
'drivers' => [
'totp' => ['enabled' => false],
],When a driver is disabled, the login-time OTP step for users who enrolled in that driver is skipped.
Simply omit it from the array:
// Only email verification is required; TOTP and SMS are optional.
'requiredSetupSteps' => ['emailVerify'],You can drive enabled from an environment variable:
'drivers' => [
'smsOtp' => [
'enabled' => (bool)env('FEATURE_SMS_OTP', false),
],
],Steps in requiredSetupSteps are evaluated in the order listed:
'requiredSetupSteps' => ['emailVerify', 'totp', 'smsOtp'],emailVerifyis always evaluated first and blocks all other steps until complete.totpis evaluated next.smsOtpis evaluated last.
Disabled steps are excluded before the order is applied, so removing totp does
not shift the position of smsOtp.
// Returns only enabled steps in configured order.
$steps = $this->Verification->getService()->getSteps();// config/app_local.php (dev overrides)
Configure::write('Verification.drivers.totp.enabled', false);Or use a conditional in config/verification.php:
'drivers' => [
'totp' => [
'enabled' => !Configure::read('debug'),
'options' => ['issuer' => 'MyApp'],
],
],| Topic | File |
|---|---|
| README | ../README.md |
| Verification flows (setup, login, OTP choice) | verification_flow.md |
| Installation | installation.md |
| Configuration reference | configuration.md |
| Environment variables | env.md |
| UsersController actions | users_controller.md |
| VerificationComponent | verification_component.md |
| VerificationHelper | verification_helper.md |
| Email verification & Email OTP | email_verification.md |
| SMS OTP | sms_verification.md |
| TOTP | totp_verification.md |
| Enable / disable individual steps | verificator_enable_disable.md |
| API reference | api/index.md |