Enhance audit logging: add new audit types for password reset and prospect image actions, and update related services to log these events

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
a.beging@eas-solutions.de
2026-04-29 15:57:30 +02:00
parent 0dd0c1bf4c
commit 6807f2b6e6
7 changed files with 71 additions and 3 deletions

View File

@@ -251,6 +251,14 @@ namespace FoodsharingSiegen.Server.Auth
user.ResetToken = resetToken;
user.ResetTokenExpiry = DateTime.UtcNow.AddMinutes(30);
Context.Audits?.Add(new Audit
{
Created = DateTime.Now,
Type = AuditType.RequestPasswordReset,
UserID = user.Id,
Data1 = user.Mail
});
await Context.SaveChangesAsync();
var resetLink = $"{baseUri.TrimEnd('/')}/reset-password/{resetToken}";