AuthenticationFilter
extends Filter
in package
Authentication filter.
Ensures user is authenticated before accessing protected routes. Redirects to login page if not authenticated.
Table of Contents
Properties
- $_authentication : Authentication
- $_loginUrl : string
- $_postFn : Closure|null
- $_preFn : Closure|null
- $_redirectParam : string
Methods
- __construct() : mixed
- post() : mixed|null
- pre() : mixed|null
- setLoginUrl() : self
- Set login URL
- checkAuthentication() : void
- Check if user is authenticated
Properties
$_authentication
private
Authentication
$_authentication
$_loginUrl
private
string
$_loginUrl
= '/login'
$_postFn
private
Closure|null
$_postFn
$_preFn
private
Closure|null
$_preFn
$_redirectParam
private
string
$_redirectParam
= 'redirect'
Methods
__construct()
public
__construct(Authentication $authentication[, string $loginUrl = '/login' ]) : mixed
Parameters
- $authentication : Authentication
- $loginUrl : string = '/login'
post()
public
post(RouteMap $route) : mixed|null
Parameters
- $route : RouteMap
Return values
mixed|nullpre()
public
pre(RouteMap $route) : mixed|null
Parameters
- $route : RouteMap
Return values
mixed|nullsetLoginUrl()
Set login URL
public
setLoginUrl(string $loginUrl) : self
Parameters
- $loginUrl : string
Return values
selfcheckAuthentication()
Check if user is authenticated
protected
checkAuthentication(RouteMap $route) : void
Parameters
- $route : RouteMap