Skip to content

Commit 5655a25

Browse files
committed
bug #534 Replace hard coded PasswordResetToken with class name variable (ker0x)
This PR was merged into the 1.0-dev branch. Discussion ---------- Replace hard coded PasswordResetToken with class name variable Commits ------- 7228d20 Replace hard coded PasswordResetToken with class name variable
2 parents ccb68bf + 7228d20 commit 5655a25

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Resources/skeleton/forgottenPassword/ForgottenPasswordController.tpl.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,15 @@ public function reset(Request $request, UserPasswordEncoderInterface $passwordEn
106106
throw $this->createNotFoundException();
107107
}
108108

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

113113
if (!$passwordResetToken) {
114114
throw $this->createNotFoundException();
115115
}
116116

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

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

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

131131
// Encode the plain password, and set it.

0 commit comments

Comments
 (0)