Feature: #101252 - Introduce ErrorHandler for 403 errors with redirect option

See forge#101252

Description

The new error handler \TYPO3\CMS\Core\Error\PageErrorHandler\RedirectLoginErrorHandler has been added, which makes it possible to redirect the user to a configurable page.

Requesting a login-protected URL would usually return a generic HTTP 403 error in case of a missing fulfilled access permissions and the configuration typolinkLinkAccessRestrictedPages = NONE (default) is set.

By enabling this new handler via the site settings, the 403 response can be handled and a custom redirect can be performed.

The RedirectLoginErrorHandler allows to define a loginRedirectTarget, which must be configured to the page, where the login process is handled. Additionally, the loginRedirectParameter must be set to the URL parameter that will be used to hand over the original URL to the target page.

The redirect ensures that the original URL is added to the configured GET parameter loginRedirectParameter, so that the user can be redirected back to the original page after a successful login.

The error handler allows return_url or redirect_url as values for loginRedirectParameter. Those values are used in extensions like EXT:felogin or EXT:oidc.

The new error handler works (with some minor exceptions) similar to the "Forbidden (HTTP Status 403)" handler in TYPO3 extension plan2net/sierrha . It will still emit generic 403 HTTP error messages in certain scenarios, like when a user is already logged in, but the permissions are not satisfied.

Impact

It is now possible to configure a login redirection process when a user has no access to a page and a 403 error is thrown, so that after login the originating URL is requested again. Previously, this required custom Middlewares or implementations of PageErrorHandlerInterface .