Feature #99311
openAdd a redirect option in FrontendUserAuthenticator Middleware
0%
Description
Using a custom oAuth2 Login, i tried to create a login via Discord. I set the logintype, then i created my Authentication Service, everything worked great. What i missed though is the redirect option. Once the TYPO3\CMS\Frontend\Middleware\FrontendUserAuthenticator kicks in and once the login is successful, the middleware just returns the response, without the option to redirect somewhere.
What i am thinking of as an MVP, is maybe a redirect GET parameter which is going to be validated just before the returned response. If it is there, then return the response with an extra Location: header. Maybe something like that:
if (count($request->getQueryParams()) > 0 && array_key_exists('redirect', $request->getQueryParams()))
$response = $this->responseFactory->createResponse()
->withHeader('Location', $request->getQueryParams()['redirect']);
return $response;
}
After the MVP, i am thinking of maybe a redirect which is generated via a pid. Instead of passing a whole URL in the redirect parameter, maybe a PID could be passed and then the Middleware could resolve this pid.
Updated by Benni Mack over 1 year ago
- Target version changed from 12 LTS to Candidate for Major Version