Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ public function reset(Request $request, UserPasswordEncoderInterface $passwordEn
throw $this->createNotFoundException();
}

$passwordResetToken = $this->getDoctrine()->getRepository(PasswordResetToken::class)->findOneBy([
'selector' => substr($tokenAndSelector, 0, PasswordResetToken::SELECTOR_LENGTH),
$passwordResetToken = $this->getDoctrine()->getRepository(<?= $token_class_name ?>::class)->findOneBy([
'selector' => substr($tokenAndSelector, 0, <?= $token_class_name ?>::SELECTOR_LENGTH),
]);

if (!$passwordResetToken) {
throw $this->createNotFoundException();
}

if ($passwordResetToken->isExpired() || !$passwordResetToken->isTokenEquals(substr($tokenAndSelector, PasswordResetToken::SELECTOR_LENGTH))) {
if ($passwordResetToken->isExpired() || !$passwordResetToken->isTokenEquals(substr($tokenAndSelector, <?= $token_class_name ?>::SELECTOR_LENGTH))) {
$this->getDoctrine()->getManager()->remove($passwordResetToken);
$this->getDoctrine()->getManager()->flush();

Expand All @@ -125,7 +125,7 @@ public function reset(Request $request, UserPasswordEncoderInterface $passwordEn
$form->handleRequest($request);

if ($form->isSubmitted() && $form->isValid()) {
// A PasswordResetToken should be used only once, remove it.
// A <?= $token_class_name ?> should be used only once, remove it.
$this->getDoctrine()->getManager()->remove($passwordResetToken);

// Encode the plain password, and set it.
Expand Down