Skip to content

Commit

Permalink
Update ModuleLoginRedirect.php
Browse files Browse the repository at this point in the history
  • Loading branch information
bright-cloud-studio committed Feb 22, 2023
1 parent 41e7daf commit cd76f3f
Showing 1 changed file with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@
use Contao;
use Contao\Config;

use Scheb\TwoFactorBundle\Security\Authentication\Exception\InvalidTwoFactorCodeException;
use Scheb\TwoFactorBundle\Security\TwoFactor\Event\TwoFactorAuthenticationEvent;
use Scheb\TwoFactorBundle\Security\TwoFactor\Event\TwoFactorAuthenticationEvents;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\Exception\TooManyLoginAttemptsAuthenticationException;


class ModuleLoginRedirect extends \Contao\ModuleLogin
{
public function generate()
Expand All @@ -34,16 +27,17 @@ protected function compile()
// perform our normal compilation functions
parent::compile();

// get authorization values
$container = \System::getContainer();
$authorizationChecker = $container->get('security.authorization_checker');

// get our selected failure page
$objTarget = $this->objModel->getRelated('jumpToFailed');

// if we have a failure page selected
if($objTarget != null) {

// get authorization values
$container = \System::getContainer();
$authorizationChecker = $container->get('security.authorization_checker');


// if value isnt empty, meaning we failed the previous login
if($this->Template->value != "") {

Expand All @@ -56,8 +50,12 @@ protected function compile()
// forward ourselves to that page
header("Location: " . $strRedirect);

// this will stop any other successive forwards, doesn't work without this surprisingly.
echo " ";

}
}

}

}
Expand Down

0 comments on commit cd76f3f

Please sign in to comment.