Configuration
Override Voyti params in your app's config/params.php using
the yiirocks/voyti key:
use YiiRocks\Voyti\Enum\EmailChangeConfirmation;
use YiiRocks\Voyti\Enum\ProfileVisibility;
use YiiRocks\Voyti\Enum\RecaptchaVersion;
use YiiRocks\Voyti\Enum\WebTheme;
return [
'yiirocks/voyti' => [
'appName' => 'My Project',
'webTheme' => WebTheme::BOOTSTRAP5,
'emailChangeConfirmation' => EmailChangeConfirmation::BOTH,
'recaptchaVersion' => RecaptchaVersion::V2,
'profileVisibility' => ProfileVisibility::PUBLIC,
],
];
General
Application name - used as TOTP issuer in 2FA QR codes and {app} placeholder in mail subjects.
Route to redirect to after a successful login (password, 2FA, or social) or logout. Must be a route registered by the host app - an unregistered route name throws a LogicException naming the misconfigured option, rather than a bare router exception.
Authentication & Registration
enableRegistration bool
true
Allow new user registration.
enableSocialNetworkRegistration bool
true
Allow social network registration. Has no effect until at least one provider is configured - see
Social Authentication.
enableEmailConfirmation bool
true
Require email confirmation.
allowPasswordRecovery bool
true
Allow password recovery.
allowAdminPasswordRecovery bool
false
Allow admin-initiated password recovery.
allowAccountDelete bool
false
Allow users to delete their account.
emailChangeConfirmation EmailChangeConfirmation
EmailChangeConfirmation::NEW
NONE (change immediately), NEW (confirm new address only), or BOTH (confirm both old and new addresses).
rememberLoginLifespan int
2592000
Remember-me cookie lifetime and idle auth timeout in seconds.
tokenConfirmationLifespan int
86400
Confirmation token validity.
tokenRecoveryLifespan int
21600
Recovery token validity.
enableSwitchIdentities bool
true
Allow admin to switch user identities.
mailAdminOnRegister ?string
null
Email notified on new registration.
recaptchaVersion RecaptchaVersion
RecaptchaVersion::V3
RecaptchaVersion::V2 or RecaptchaVersion::V3. Requires the optional yiirocks/recaptcha package plus a site key and secret configured for the selected version via that package's own RecaptchaRegistry::configure() - without it, forms silently render and validate without reCAPTCHA.
Two-Factor Authentication
enableTwoFactorAuthentication bool
false
Enable 2FA.
twoFactorAuthenticationForcedPermissions array
[]
Permissions that require 2FA.
GDPR
enableGdprCompliance bool
false
Enable GDPR features.
gdprAnonymizePrefix string
'GDPR'
Prefix for anonymized usernames.
gdprExportProperties array
['email', 'username', 'userProfile.public_email', 'userProfile.name', 'userProfile.gravatar_email', 'userProfile.location', 'userProfile.website', 'userProfile.bio', 'userProfile.birthday', 'userSessions', 'userSocialAccount']
Properties included in the data export (JSON). userSessions exports each login's ip, user_agent, created_at, updated_at, userSocialAccount exports each linked account's provider, username, email, created_at, and data (the decoded provider profile payload).
Session & Security
Max password age in days before a user is forced to set a new one. 0 disables password expiration entirely.
enablePasswordComplexity bool
false
Require passwords to contain an uppercase letter, a lowercase letter, a digit, and a special character.
passwordHistoryLimit int
10
Number of previous passwords remembered per user to prevent reuse. Only enforced when maxPasswordAge is greater than 0.
administratorPermissionName string
'voyti-admin'
Permission name granting admin access.
profileVisibility ProfileVisibility
ProfileVisibility::USERS
Profile visibility: OWNER = owner only, ADMIN = owner + admins, USERS = any authenticated user, PUBLIC = public.
Record admin actions (RBAC and user management changes) to the user_audit_log table, viewable at admin/audit-log/.
Views & Mail
webTheme WebTheme
WebTheme::BOOTSTRAP5
Shipped theme to use as the base for web templates. Custom viewPath overrides are checked first; missing templates fall back to this selected theme.
Optional custom directory for web template overrides. When a template is not found here, falls back to the selected webTheme. Leave null to use only shipped templates.
mailPath string
VoytiConfig::DEFAULT_MAIL_PATH
Base path for mail templates. If a template is not found here, falls back to the default mail templates.
REST API
API token lifetime in seconds. 0 disables expiry entirely (tokens never expire).
The REST API is enabled by pulling the voyti-routes-api
config group into your router (see
Quick Start). It
authenticates via a Bearer token, not the web session/CSRF cookie
- issue one with voyti:api-token:generate (see
Console commands) and send it as
Authorization: Bearer <token>.
AccessRuleMiddleware still applies afterwards to
enforce administratorPermissionName.