Start two-factor authentication for User
Modules must implement this method unless they do not need to generate or send authentication codes to the user. Below are details on how to implement this method:
A. For modules that generate and validate their own authentication codes:
- Generate an authentication code for user
- Save the code to session
- Send the code to the user via whatever TFA channel is used
- Call parent::startUser($user)
- Return true (if no errors)
B. For modules that use an external service to generate, send and validate codes:
- Call on the external service to generate and the code to user
- Call parent::startUser($user)
- Return true (if no errors)
C. Modules that do not generate or send codes, but only validate them (i.e. TOTP): You can omit implementation, leaving just the built-in one below. But if you do implement it, make sure you call the parent::startUser($user).
Usage
$bool = $tfa->startUser(User $user, array $settings);
Arguments
Name | Type(s) | Description |
---|---|---|
user | User | |
settings | array | Settings configured by user |
Return value
bool
True on success, false on fail
API reference based on ProcessWire core version 3.0.236