Skip to content

Commit

Permalink
Merge branch '6.0' into 6.1
Browse files Browse the repository at this point in the history
* 6.0:
  [HttpFoundation] Always return strings from accept headers
  decode URL-encoded characters in DSN's usernames/passwords
  [Security/Http] cs fixes
  • Loading branch information
xabbuh committed Sep 11, 2022
2 parents dbbc216 + 34bb455 commit c2d2e1b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions LoginLink/LoginLinkHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ final class LoginLinkHandler implements LoginLinkHandlerInterface
private UrlGeneratorInterface $urlGenerator;
private UserProviderInterface $userProvider;
private array $options;
private SignatureHasher $signatureHashUtil;
private SignatureHasher $signatureHasher;

public function __construct(UrlGeneratorInterface $urlGenerator, UserProviderInterface $userProvider, SignatureHasher $signatureHashUtil, array $options)
public function __construct(UrlGeneratorInterface $urlGenerator, UserProviderInterface $userProvider, SignatureHasher $signatureHasher, array $options)
{
$this->urlGenerator = $urlGenerator;
$this->userProvider = $userProvider;
$this->signatureHashUtil = $signatureHashUtil;
$this->signatureHasher = $signatureHasher;
$this->options = array_merge([
'route_name' => null,
'lifetime' => 600,
Expand All @@ -52,7 +52,7 @@ public function createLoginLink(UserInterface $user, Request $request = null): L
$parameters = [
'user' => $user->getUserIdentifier(),
'expires' => $expires,
'hash' => $this->signatureHashUtil->computeSignatureHash($user, $expires),
'hash' => $this->signatureHasher->computeSignatureHash($user, $expires),
];

if ($request) {
Expand Down Expand Up @@ -93,7 +93,7 @@ public function consumeLoginLink(Request $request): UserInterface
$expires = $request->get('expires');

try {
$this->signatureHashUtil->verifySignatureHash($user, $expires, $hash);
$this->signatureHasher->verifySignatureHash($user, $expires, $hash);
} catch (ExpiredSignatureException $e) {
throw new ExpiredLoginLinkException(ucfirst(str_ireplace('signature', 'login link', $e->getMessage())), 0, $e);
} catch (InvalidSignatureException $e) {
Expand Down
2 changes: 1 addition & 1 deletion RememberMe/AbstractRememberMeHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function __construct(UserProviderInterface $userProvider, RequestStack $r
* - Create a new remember-me cookie to be sent with the response (using {@see createCookie()});
* - If you store the token somewhere else (e.g. in a database), invalidate the stored token.
*
* @throws AuthenticationException throw this exception if the remember me details are not accepted
* @throws AuthenticationException If the remember-me details are not accepted
*/
abstract protected function processRememberMe(RememberMeDetails $rememberMeDetails, UserInterface $user): void;

Expand Down

0 comments on commit c2d2e1b

Please sign in to comment.