Loading modules/o365_sso/src/Controller/UserLoginController.php +5 −7 Original line number Diff line number Diff line Loading @@ -4,11 +4,11 @@ namespace Drupal\o365_sso\Controller; use Drupal\Core\Controller\ControllerBase; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Routing\TrustedRedirectResponse; use Drupal\externalauth\ExternalAuth; use Drupal\o365\AuthenticationService; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\o365\GraphService; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\RedirectResponse; /** * UserLoginController. Used when returned from the callback. Loading Loading @@ -67,7 +67,7 @@ class UserLoginController extends ControllerBase { /** * Login a user. * * @return \Drupal\Core\Routing\TrustedRedirectResponse * @return \Symfony\Component\HttpFoundation\RedirectResponse * The redirect to the set URL in config. * * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException Loading Loading @@ -112,16 +112,14 @@ class UserLoginController extends ControllerBase { } elseif ($account->isBlocked()) { $this->messenger()->addError(t('The requested account is blocked')); $response = new TrustedRedirectResponse('/user/login'); return $response->send(); return $this->redirect('user.login'); } // Log the user in. $this->externalAuth->userLoginFinalize($account, $o365_id, 'o365_sso'); // Return the redirect. $response = new TrustedRedirectResponse($redirectUrl); return $response->send(); return new RedirectResponse($redirectUrl); } } Loading
modules/o365_sso/src/Controller/UserLoginController.php +5 −7 Original line number Diff line number Diff line Loading @@ -4,11 +4,11 @@ namespace Drupal\o365_sso\Controller; use Drupal\Core\Controller\ControllerBase; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Routing\TrustedRedirectResponse; use Drupal\externalauth\ExternalAuth; use Drupal\o365\AuthenticationService; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\o365\GraphService; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\RedirectResponse; /** * UserLoginController. Used when returned from the callback. Loading Loading @@ -67,7 +67,7 @@ class UserLoginController extends ControllerBase { /** * Login a user. * * @return \Drupal\Core\Routing\TrustedRedirectResponse * @return \Symfony\Component\HttpFoundation\RedirectResponse * The redirect to the set URL in config. * * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException Loading Loading @@ -112,16 +112,14 @@ class UserLoginController extends ControllerBase { } elseif ($account->isBlocked()) { $this->messenger()->addError(t('The requested account is blocked')); $response = new TrustedRedirectResponse('/user/login'); return $response->send(); return $this->redirect('user.login'); } // Log the user in. $this->externalAuth->userLoginFinalize($account, $o365_id, 'o365_sso'); // Return the redirect. $response = new TrustedRedirectResponse($redirectUrl); return $response->send(); return new RedirectResponse($redirectUrl); } }