Skip to content

Kirby 5.0.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
$userrequired Kirby\Cms\User no default value User to generate the code for
$optionsrequired array no default value 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

The generated and sent code

Parent class

Kirby\Cms\Auth\EmailChallenge