AuthGuard
Middleware to catch requests that fail because they require user authentication.
Tags
Table of Contents
$authenticator | Authenticator | |
---|---|---|
__construct() | Constructor. | mixed |
__invoke() | Invoke the AuthGuard middleware, throwing an exception if there is no authenticated user in the session. | ResponseInterface |
Properties
$authenticator
protected
Authenticator
$authenticator
Methods
__construct()
Constructor.
public
__construct(
$authenticator :
Authenticator
)
: mixed
Parameters
- $authenticator : Authenticator
The current authentication object.
Return values
mixed__invoke()
Invoke the AuthGuard middleware, throwing an exception if there is no authenticated user in the session.
public
__invoke(
$request :
ServerRequestInterface
, $response :
ResponseInterface
, $next :
callable
)
: ResponseInterface
Parameters
- $request : ServerRequestInterface
PSR7 request
- $response : ResponseInterface
PSR7 response
- $next : callable
Next middleware