From 49e73cde9c856bee9f36e2cedb9742bd6a3e9942 Mon Sep 17 00:00:00 2001 From: whoswhip Date: Sat, 7 Mar 2026 17:56:06 -0500 Subject: [PATCH] fix(auth): replace HMAC token generation with SHA256 for email verification the HMAC is intended for other actions like change email, i just forgot and was rushing at the time, whoops! --- SharpbinV3.Server/Services/AuthService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SharpbinV3.Server/Services/AuthService.cs b/SharpbinV3.Server/Services/AuthService.cs index aa9c825..ed331c6 100644 --- a/SharpbinV3.Server/Services/AuthService.cs +++ b/SharpbinV3.Server/Services/AuthService.cs @@ -233,7 +233,7 @@ namespace SharpbinV3.Server.Services } string token = Utilities.GenerateSecureRandomString(EmailVerificationTokenLength); - string tokenHash = Utilities.ComputeHmacSha256(token, _emailSettings.Verification_HMAC_Secret); + string tokenHash = Utilities.ComputeSha256(token); await _email.SendAsync( user.Email, @@ -259,7 +259,7 @@ namespace SharpbinV3.Server.Services if (string.IsNullOrWhiteSpace(_emailSettings.Verification_HMAC_Secret)) return (false, "Email verification is not configured."); - string tokenHash = Utilities.ComputeHmacSha256(token, _emailSettings.Verification_HMAC_Secret); + string tokenHash = Utilities.ComputeSha256(token); var verificationToken = await _db.EmailVerificationTokens.Include(t => t.User).FirstOrDefaultAsync(t => t.TokenHash == tokenHash); if (