Issue Bug Closed

#93492FE_Login - Redirect after login error didn't work because of cookieWarning implementation

Paul Kamma 02/11/21, 17:11 updated 05/11/21, 16:00

Description

When a redirect on login error is setted the redirect didnt work.
I peeked inside the code and found this part where he leaves before he can redirect the user.

sysext/felogin/Classes/Controller/LoginController.php at line 117

public function initializeAction(): void
{
    $this->loginType = (string)$this->requestHandler->getPropertyFromGetAndPost('logintype');
    $this->configuration = RedirectConfiguration::fromSettings($this->settings);
    if ($this->isLoginOrLogoutInProgress() && !$this->isRedirectDisabled()) {

        if (!$this->userAspect->isLoggedIn() && $this->userService->cookieWarningRequired()) {
            $this->showCookieWarning = true;
// THIS RETURN PREVENTS THAT IT CONTINUES TO THE REDIRECT
// WHEN I REMOVE IT IT WORKS
            return;
        }

        $this->redirectUrl = $this->redirectHandler->processRedirect(
            $this->loginType,
            $this->configuration,
            $this->request->hasArgument('redirectReferrer') ? $this->request->getArgument('redirectReferrer') : ''
        );
    }
}

Maybe the return have to be removed.

Reviews 2