diff --git a/src/Controller/RedirectController.php b/src/Controller/RedirectController.php index ec91bc57..57cb0a8a 100644 --- a/src/Controller/RedirectController.php +++ b/src/Controller/RedirectController.php @@ -59,13 +59,6 @@ class RedirectController extends AbstractController $locale = $user->getLanguage(); } - //Check if the user needs to change the password. In that case redirect him to settings_page - if ($user instanceof User && $user->isNeedPwChange()) { - $this->session->getFlashBag()->add('warning', $this->translator->trans('flash.password_change_needed')); - - return $this->redirectToRoute('user_settings', ['_locale' => $locale]); - } - //$new_url = str_replace($request->getPathInfo(), '/' . $locale . $request->getPathInfo(), $request->getUri()); $new_url = $request->getUriForPath('/'.$locale.$request->getPathInfo()); diff --git a/tests/Controller/RedirectControllerTest.php b/tests/Controller/RedirectControllerTest.php index 48c1283b..ac77d8e3 100644 --- a/tests/Controller/RedirectControllerTest.php +++ b/tests/Controller/RedirectControllerTest.php @@ -120,28 +120,4 @@ class RedirectControllerTest extends WebTestCase $this->client->request('GET', $input_path); $this->assertEquals($redirect_path, $this->client->getResponse()->headers->get('Location')); } - - /** - * Test if the user is redirected to password change page if he should do that. - * - * @depends testAddLocale - * @group slow - * @testWith ["de"] - * ["en"] - */ - public function testRedirectToPasswordChange(string $locale) - { - /** @var User $user */ - $user = $this->userRepo->findOneBy(['name' => 'user']); - - //Test for german user - $user->setLanguage($locale); - $user->setNeedPwChange(true); - $this->em->flush(); - - $this->client->followRedirects(false); - - $this->client->request('GET', '/part/3'); - $this->assertEquals('http://localhost' . "/$locale/user/settings", $this->client->getResponse()->headers->get('Location')); - } }