Skip to content

Kirby 4.1.2

$auth->verifyChallenge()

Verifies an authentication code that was requested with the createChallenge() method; if successful, the user is automatically logged in

$auth->verifyChallenge(string $code): Kirby\Cms\User

Parameters

Name Type Default Description
$code * string User-provided auth code to verify

Return type

Kirby\Cms\User

Exceptions

Type Description
Kirby\Exception\PermissionException If the rate limit was exceeded, the challenge timed out, the code
is incorrect or if any other error occurred with debug mode off
Kirby\Exception\NotFoundException If the user from the challenge doesn't exist
Kirby\Exception\InvalidArgumentException If no authentication challenge is active
Kirby\Exception\LogicException If the authentication challenge is invalid

Parent class

Kirby\Cms\Auth