fix(api): log user id instead of email on cognito role sync (SEC-29)

Keep AuthResponse.Email unchanged so CodeQL alert 1 closes without altering the callback payload.
This commit is contained in:
Adam Moussa 2026-08-20 12:15:57 -04:00
parent 05d87b2e04
commit f06ffb6fad
No known key found for this signature in database

View file

@ -120,8 +120,8 @@ public class AuthController : ControllerBase
if (user.Role != role) if (user.Role != role)
{ {
// Fix: API-M13 — log previous role on Cognito-synced role changes // Fix: API-M13 — log previous role on Cognito-synced role changes
_logger.LogInformation("User {Email} role changed from {OldRole} to {NewRole} via Cognito sync", _logger.LogInformation("User {UserId} role changed from {OldRole} to {NewRole} via Cognito sync",
user.Email, user.Role, role); user.Id, user.Role, role);
user.Role = role; user.Role = role;
changed = true; changed = true;
} }