Skip to content

Kirby 5.0.4

$auth->createChallenge()

Creates an authentication challenge (one-time auth code)

$auth->createChallenge(string $email, bool $long = false, 'login'|'password-reset'|'2fa' $mode = 'login'): Kirby\Cms\Auth\Status

Parameters

Name Type Default Description
$emailrequired string no default value
$long bool false If true, a long session will be created
$mode 'login'or'password-reset'or'2fa' 'login' Purpose of the code

Return type

Kirby\Cms\Auth\Status

This method modifies the existing $auth object it is applied to and returns it again.

Exceptions

Type Description
Kirby\Exception\LogicException If there is no suitable authentication challenge (only in debug mode)
Kirby\Exception\NotFoundException If the user does not exist (only in debug mode)
Kirby\Exception\PermissionException If the rate limit is exceeded

Parent class

Kirby\Cms\Auth