Skip to content

LoginRedirectEntryPoint

The entry point for the session/form-login firewall: a 302 redirect back to the login path.

Complements, and does not duplicate, the existing anonymous-access forward already handled by Quiote\Middleware\SecurityMiddleware via SecurityService::decide() + ForwardService (unchanged — authentication and authorization stay separate concerns) — this entry point only fires when a login attempt itself fails (e.g. a bad password on the login POST), not on plain unauthenticated browsing.

final class LoginRedirectEntryPoint implements EntryPointInterface

ImplementsEntryPointInterface
Since1.0.0
SourceEntryPoint/LoginRedirectEntryPoint.php

public function __construct(string $loginPath = '/login', string $errorQueryParameter = 'error'): mixed

The query parameter appended to signal a failed attempt (e.g. ?error=1).

ParameterTypeDescription
$loginPathstringThe path to redirect back to.
$errorQueryParameterstringThe query parameter appended to signal a failed attempt (e.g. ?error=1).

Returns mixed

MethodDescription
start(ServerRequestInterface $request, AuthenticationException $exception): ResponseInterface

public function start(ServerRequestInterface $request, AuthenticationException $exception): ResponseInterface

The exception the failing authenticator threw.

ParameterTypeDescription
$requestServerRequestInterfaceThe request that failed authentication (the login POST).
$exceptionAuthenticationExceptionThe exception the failing authenticator threw.

Returns ResponseInterface — A 302 redirect back to the login path with the error query parameter set.