Skip to content

Commit a7d0d82

Browse files
committed
Fix RememberMe with null password
1 parent b4a63f9 commit a7d0d82

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Symfony/Component/Security/Http/RememberMe/TokenBasedRememberMeServices.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ protected function onLoginSuccess(Request $request, Response $response, TokenInt
9191
/**
9292
* Generates the cookie value.
9393
*
94-
* @param int $expires The Unix timestamp when the cookie expires
95-
* @param string $password The encoded password
94+
* @param int $expires The Unix timestamp when the cookie expires
95+
* @param string|null $password The encoded password
9696
*
9797
* @return string
9898
*/
99-
protected function generateCookieValue(string $class, string $username, int $expires, string $password)
99+
protected function generateCookieValue(string $class, string $username, int $expires, ?string $password)
100100
{
101101
// $username is encoded because it might contain COOKIE_DELIMITER,
102102
// we assume other values don't
@@ -111,12 +111,12 @@ protected function generateCookieValue(string $class, string $username, int $exp
111111
/**
112112
* Generates a hash for the cookie to ensure it is not being tampered with.
113113
*
114-
* @param int $expires The Unix timestamp when the cookie expires
115-
* @param string $password The encoded password
114+
* @param int $expires The Unix timestamp when the cookie expires
115+
* @param string|null $password The encoded password
116116
*
117117
* @return string
118118
*/
119-
protected function generateCookieHash(string $class, string $username, int $expires, string $password)
119+
protected function generateCookieHash(string $class, string $username, int $expires, ?string $password)
120120
{
121121
return hash_hmac('sha256', $class.self::COOKIE_DELIMITER.$username.self::COOKIE_DELIMITER.$expires.self::COOKIE_DELIMITER.$password, $this->getSecret());
122122
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy