Skip to content

Kirby 5.0.4

$user->validatePassword()

Compares the given password with the stored one

$user->validatePassword(string|null $password = null): bool

Parameters

Name Type Default
$password stringornull null

Return type

bool

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

Exceptions

Type Description
Kirby\Exception\NotFoundException If the user has no password
Kirby\Exception\InvalidArgumentException If the entered password is not valid
or does not match the user password

Parent class

Kirby\Cms\User