Skip to content

Kirby 3.8.4

EmailChallenge::create()

Generates a random one-time auth code and returns that code for later verification

EmailChallenge::create(Kirby\Cms\User $user, array $options): string

Parameters

Name Type Default Description
$user * Kirby\Cms\User User to generate the code for
$options * array Details of the challenge request:
- 'mode': Purpose of the code ('login', 'reset' or '2fa')
- 'timeout': Number of seconds the code will be valid for

Return type

string

Parent class

Kirby\Cms\Auth\EmailChallenge