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:
@@ -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}";
|
||||
|
||||
Reference in New Issue
Block a user