Skip to content

Kirby 6.0.0

$user->fromBasicAuth()

Returns the logged in user by checking for a basic authentication header with valid credentials

$user->fromBasicAuth(BasicAuth|null $auth = null): User|null

Parameters

Name Type Default
$auth Kirby\Http\Request\Auth\BasicAuthornull null

Return types

Kirby\Cms\Userornull

Exceptions

Type Description
Kirby\Exception\InvalidArgumentException if the authorization header is invalid
Kirby\Exception\PermissionException if basic authentication is not allowed

Parent class

Kirby\Auth\User