File tree Expand file tree Collapse file tree
src/Authentication/Authenticators
tests/Authentication/Authenticators Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ public function attempt(array $credentials): Result
103103 // Record a banned login attempt.
104104 $ this ->tokenLoginModel ->recordLoginAttempt (
105105 self ::ID_TYPE_JWT ,
106- $ credentials ['token ' ] ?? '' ,
106+ ' sha256: ' . hash ( ' sha256 ' , $ credentials ['token ' ] ?? '' ) ,
107107 false ,
108108 $ ipAddress ,
109109 $ userAgent ,
@@ -125,7 +125,7 @@ public function attempt(array $credentials): Result
125125 // Record a successful login attempt.
126126 $ this ->tokenLoginModel ->recordLoginAttempt (
127127 self ::ID_TYPE_JWT ,
128- $ credentials ['token ' ] ?? '' ,
128+ ' sha256: ' . hash ( ' sha256 ' , $ credentials ['token ' ]) ,
129129 true ,
130130 $ ipAddress ,
131131 $ userAgent ,
Original file line number Diff line number Diff line change @@ -226,7 +226,7 @@ public function testAttemptBannedUser(): void
226226 // The login attempt should have been recorded
227227 $ this ->seeInDatabase ('auth_token_logins ' , [
228228 'id_type ' => JWT ::ID_TYPE_JWT ,
229- 'identifier ' => $ token ,
229+ 'identifier ' => ' sha256: ' . hash ( ' sha256 ' , $ token) ,
230230 'success ' => 0 ,
231231 'user_id ' => $ this ->user ->id ,
232232 ]);
@@ -256,7 +256,7 @@ public function testAttemptSuccess(): void
256256 // A login attempt should have been recorded
257257 $ this ->seeInDatabase ('auth_token_logins ' , [
258258 'id_type ' => JWT ::ID_TYPE_JWT ,
259- 'identifier ' => $ token ,
259+ 'identifier ' => ' sha256: ' . hash ( ' sha256 ' , $ token) ,
260260 'success ' => 1 ,
261261 ]);
262262 }
You can’t perform that action at this time.
0 commit comments