Bug #91844

felogin Redirect to referer is not working at all in combination with fe_login_mode and Site config 403 errorHandler

Added by Stefan P 14 days ago. Updated 13 days ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Authentication
Target version:
-
Start date:
2020-07-23
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

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


Related issues

Related to TYPO3 Core - Bug #90157: missing possibility to send return_url Parameter with 403 standard errorhandler New 2020-01-20

History

#1 Updated by Stefan P 14 days ago

  • Related to Bug #90157: missing possibility to send return_url Parameter with 403 standard errorhandler added

#2 Updated by Stefan P 13 days ago

My current workaround is this:

Extend \TYPO3\CMS\Core\Error\PageErrorHandler\PageContentErrorHandler and use it as :

  -
    errorCode: '403'
    errorHandler: PHP
    errorContentSource: 't3://page?uid=123'
    errorPhpClassFQCN: 'Vendor\Package\AccessDeniedPageContentErrorHandler'

Override 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.

Also available in: Atom PDF