mini\Exceptions\AuthenticationRequiredException
class
Documentation
Exception thrown when an operation requires authentication
Maps to HTTP 401 (Unauthorized). Distinct from AccessDeniedException (403) which means "authenticated but not permitted".
Applications can register an exception converter to redirect to a login page:
$dispatcher->registerExceptionConverter(function(AuthenticationRequiredException $e): ResponseInterface {
$returnTo = urlencode(request()->getRequestTarget());
return new Response('', ['Location' => "/login/?returnTo=$returnTo"], 303);
});
Inheritance
Extends: Exception
Implements:
Throwable
Stringable
Properties (4)
protected
mixed
$message
protected
mixed
$code
protected
string $file
protected
int $line
Methods (10)
Documentation missing
public
__wakeup()
inherited from Exception
Documentation missing
public
final
getMessage()
inherited from Exception
Documentation missing
public
final
getCode()
inherited from Exception
Documentation missing
public
final
getFile()
inherited from Exception
Documentation missing
public
final
getLine()
inherited from Exception
Documentation missing
public
final
getTrace()
inherited from Exception
Documentation missing
public
final
getPrevious()
inherited from Exception
Documentation missing
public
final
getTraceAsString()
inherited from Exception
Documentation missing
public
__toString()
inherited from Exception
Documentation missing