Skip to content

Kirby 3.6.6

Challenge::create()

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

Challenge::create(Kirby\Cms\User $user, array $options): string|null

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|null

Parent class

Kirby\Cms\Auth\Challenge