Skip to content

Commit

Permalink
Allow all source to reset password (#10234)
Browse files Browse the repository at this point in the history
  • Loading branch information
Remg committed May 17, 2024
1 parent 11cf4dc commit 7a5fcd3
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/Controller/EnMarche/Security/SecurityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use App\Form\LoginType;
use App\Membership\AdherentChangeEmailHandler;
use App\Membership\AdherentResetPasswordHandler;
use App\Membership\MembershipSourceEnum;
use App\OAuth\App\AuthAppUrlManager;
use App\OAuth\App\PlatformAuthUrlGenerator;
use App\Repository\AdherentRepository;
Expand Down Expand Up @@ -91,16 +90,7 @@ public function retrieveForgotPasswordAction(
if ($form->isSubmitted() && $form->isValid()) {
$email = $form->get('email')->getData();

if (
($adherent = $adherentRepository->findOneByEmail($email))
&& (
$currentApp === $adherent->getSource()
|| (
\in_array($adherent->getSource(), [null, MembershipSourceEnum::RENAISSANCE])
&& \in_array($currentApp, [MembershipSourceEnum::JEMENGAGE, MembershipSourceEnum::RENAISSANCE], true)
)
)
) {
if ($adherent = $adherentRepository->findOneByEmail($email)) {
$handler->handle($adherent, $currentApp);
}

Expand Down

0 comments on commit 7a5fcd3

Please sign in to comment.