UserFrosting API

AuthGuard

Middleware to catch requests that fail because they require user authentication.

Tags
author

Alex Weissman (https://alexanderweissman.com)

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

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

Return values
ResponseInterface

Search results