Skip to content

Commit

Permalink
Allow password reset callback to modify the result (#47641)
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell authored Jul 4, 2023
1 parent 999b633 commit 6543ca6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Illuminate/Auth/Passwords/PasswordBroker.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ public function sendResetLink(array $credentials, Closure $callback = null)
$token = $this->tokens->create($user);

if ($callback) {
$callback($user, $token);
} else {
// Once we have the reset token, we are ready to send the message out to this
// user with a link to reset their password. We will then redirect back to
// the current URI having nothing set in the session to indicate errors.
$user->sendPasswordResetNotification($token);
return $callback($user, $token) ?? static::RESET_LINK_SENT;
}

// Once we have the reset token, we are ready to send the message out to this
// user with a link to reset their password. We will then redirect back to
// the current URI having nothing set in the session to indicate errors.
$user->sendPasswordResetNotification($token);

return static::RESET_LINK_SENT;
}

Expand Down

0 comments on commit 6543ca6

Please sign in to comment.