AuthRule
Aura Router rule to test user is authenticated.
Instance Methods
| Returns | Signature and Description |
|---|---|
bool | __invoke(, )Check if the Request matches the Route. |
| Returns | Signature and Description |
|---|---|
Principal | getPrincipal()Gets the stored principal, or the anonymous user if none was found. |
Method Details
__invoke
public function
__invoke(ServerRequestInterface $request, Route $route)Check if the Request matches the Route.
| Name | Type | Description |
|---|---|---|
$request | ServerRequestInterface | The HTTP request |
$route | Route | The route. |
| Type | Description |
|---|---|
bool | True on success, false on failure |
getPrincipal
protected function
getPrincipal(ServerRequestInterface $request)Gets the stored principal, or the anonymous user if none was found.
| Name | Type | Description |
|---|---|---|
$request | ServerRequestInterface | The HTTP request |
| Type | Description |
|---|---|
Principal | The authenticated principal |