$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 |
|---|---|---|---|
| $coderequired | string |
no default value | User-provided auth code to verify |
Return type
User object of the logged-in user
This method modifies the existing $auth object it is applied to and returns it again.
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 |