class Auth implements ExtenderInterface

Methods

addPasswordChecker(string $identifier, callable|string $callback)

Add a new password checker.

removePasswordChecker(string $identifier)

Remove a password checker.

void
extend( Container $container, Extension|null $extension = null)

No description

Details

Auth addPasswordChecker(string $identifier, callable|string $callback)

Add a new password checker.

Parameters

string $identifier : Unique identifier for password checker.
callable|string $callback : A closure or invokable class that contains the logic of the password checker. The callable should accept: - $user: An instance of the User model. - $password: A string. The callable should return: - `true` if the given password is valid. - `null` (or not return anything) if the given password is invalid, or this checker does not apply. Generally, `null` should be returned instead of `false` so that other password checkers can run. - `false` if the given password is invalid, and no other checkers should be considered. Evaluation will be immediately halted if any checkers return `false`.

Return Value

Auth

Auth removePasswordChecker(string $identifier)

Remove a password checker.

Parameters

string $identifier : The unique identifier of the password checker to remove.

Return Value

Auth

void extend( Container $container, Extension|null $extension = null)

Parameters

Container $container
Extension|null $extension

Return Value

void