Skip to content

Commit 6113fdd

Browse files
committed
Fix issue :>
1 parent b2fd823 commit 6113fdd

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

API/Controller/Tokens/ReportTokens.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public async Task<IActionResult> ReportTokens(
5151
var hashes = new string[body.Secrets.Length];
5252
for (int i = 0; i < body.Secrets.Length; i++)
5353
{
54-
body.Secrets[i] = HashingUtils.HashSha256(body.Secrets[i]);
54+
hashes[i] = HashingUtils.HashToken(body.Secrets[i]);
5555
}
5656

5757
nAffected = await _db.ApiTokens

Common/Utils/HashingUtils.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,10 @@ public static VerifyHashResult VerifyPassword(string password, string combinedHa
105105

106106
public static string HashToken(string token)
107107
{
108+
// BE CAREFUL, changing this will break leaked token reporting.
108109
return HashSha256(token);
109110
}
111+
110112
public static VerifyHashResult VerifyToken(string token, string hashedToken)
111113
{
112114
if (string.IsNullOrEmpty(token)) return VerifyHashFailureResult;

0 commit comments

Comments
 (0)