Skip to content

Commit 8d41c27

Browse files
committed
Cleaning up password management code.
1 parent 5c4541b commit 8d41c27

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/Illuminate/Auth/Passwords/DatabaseTokenRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function exists(CanResetPasswordContract $user, $token)
125125

126126
return $record &&
127127
! $this->tokenExpired($record['created_at']) &&
128-
$this->hasher->check($token, $record['token']);
128+
$this->hasher->check($token, $record['token']);
129129
}
130130

131131
/**

src/Illuminate/Auth/Passwords/PasswordBroker.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ public function reset(array $credentials, Closure $callback)
9191
return $user;
9292
}
9393

94-
$pass = $credentials['password'];
94+
$password = $credentials['password'];
9595

96-
// Once we have called this callback, we will remove this token row from the
97-
// table and return the response from this callback so the user gets sent
98-
// to the destination given by the developers from the callback return.
99-
$callback($user, $pass);
96+
// Once the reset has been validated, we'll call the given callback with the
97+
// new password. This gives the user an opportunity to store the password
98+
// in their persistent storage. Then we'll delete the token and return.
99+
$callback($user, $password);
100100

101101
$this->tokens->delete($credentials['token']);
102102

@@ -152,7 +152,8 @@ public function validateNewPassword(array $credentials)
152152
];
153153

154154
return call_user_func(
155-
$this->passwordValidator, $credentials) && $password === $confirm;
155+
$this->passwordValidator, $credentials
156+
) && $password === $confirm;
156157
}
157158

158159
return $this->validatePasswordWithDefaults($credentials);

0 commit comments

Comments
 (0)