$user->get()
Returns the currently logged in user
$user->get(Session|array|null $session = null, bool $allowImpersonation = true): User|null
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| $session | Kirby\Session\Sessionorarrayornull |
null
|
|
| $allowImpersonation | bool |
true
|
If set to false, only the actually logged in user will be returned |
Return types
Kirby\Cms\Userornull
Exceptions
| Type | Description |
|---|---|
Throwable |
If an authentication error occurred |