public SuccessfulLoginAuditMessage(User user) { Category = "SUCCESSFUL_LOGIN"; Description = $"User {user.Email} (id: {user.Id}) logged in"; AffectedEntity = new Audit.Types.Entity { Type = UserTypeName, Id = user.Id }; }
public FailedLoginAuditMessage(string emailAddress, User user) { Category = "FAILED_LOGIN"; AffectedEntity = new Audit.Types.Entity { Type = UserTypeName, Id = user.Id }; Description = $"User {user.Email} (id: {user.Id})attempted to login with the incorrect password"; ChangedProperties = new List <PropertyUpdate> { PropertyUpdate.FromInt(nameof(user.FailedLoginAttempts), user.FailedLoginAttempts) }; }