Skip to content

Kirby 4.4.1

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', 'password-reset' or '2fa')
- 'timeout': Number of seconds the code will be valid for

Return type

string

Parent class

Kirby\Cms\Auth\EmailChallenge