felogin Redirect to referer is not working at all in combination with fe_login_mode and Site config 403 errorHandler
When having protected pages which should show the login form for non-authenticated users you need to have this erroHandler:
errorCode: '403' errorHandler: Page errorContentSource: 't3://page?uid=12345'
This page has a felogin plugin configured to redirect back to the referer. This does not work at all: the login itself works but you just stay on the login page instead of being returned.
On v8 everything worked fine -> regression.
Probably related: #90157
My current workaround is this:
\TYPO3\CMS\Core\Error\PageErrorHandler\PageContentErrorHandler and use it as :
- errorCode: '403' errorHandler: PHP errorContentSource: 't3://page?uid=123' errorPhpClassFQCN: 'Vendor\Package\AccessDeniedPageContentErrorHandler'
handlePageError in there and alter the resolved url like this:
$parsedUrlParts = \parse_url($resolvedUrl); $resolvedUrl .= (isset($parsedUrlParts['query']) ? '&' : '?') . 'referer=' . \urlencode((string)$request->getUri());
Other use cases may need other changes to the url, this one is working for referer mode of felogin.