mirror of
https://github.com/bitwarden/server
synced 2025-12-16 08:13:33 +00:00
log events to various organization indexes as well
This commit is contained in:
@@ -425,7 +425,7 @@ namespace Bit.Core.Services
|
||||
user.Key = key;
|
||||
|
||||
await _userRepository.ReplaceAsync(user);
|
||||
await _eventService.LogUserEventAsync(user.Id, EventType.User_ChangedPassword);
|
||||
await _eventService.LogUserEventAsync(user.Id, _currentContext, EventType.User_ChangedPassword);
|
||||
|
||||
return IdentityResult.Success;
|
||||
}
|
||||
@@ -503,7 +503,7 @@ namespace Bit.Core.Services
|
||||
user.TwoFactorRecoveryCode = CoreHelpers.SecureRandomString(32, upper: false, special: false);
|
||||
}
|
||||
await SaveUserAsync(user);
|
||||
await _eventService.LogUserEventAsync(user.Id, EventType.User_Enabled2fa);
|
||||
await _eventService.LogUserEventAsync(user.Id, _currentContext, EventType.User_Enabled2fa);
|
||||
}
|
||||
|
||||
public async Task DisableTwoFactorProviderAsync(User user, TwoFactorProviderType type)
|
||||
@@ -517,7 +517,7 @@ namespace Bit.Core.Services
|
||||
providers.Remove(type);
|
||||
user.SetTwoFactorProviders(providers);
|
||||
await SaveUserAsync(user);
|
||||
await _eventService.LogUserEventAsync(user.Id, EventType.User_Disabled2fa);
|
||||
await _eventService.LogUserEventAsync(user.Id, _currentContext, EventType.User_Disabled2fa);
|
||||
}
|
||||
|
||||
public async Task<bool> RecoverTwoFactorAsync(string email, string masterPassword, string recoveryCode)
|
||||
@@ -542,7 +542,7 @@ namespace Bit.Core.Services
|
||||
user.TwoFactorProviders = null;
|
||||
user.TwoFactorRecoveryCode = CoreHelpers.SecureRandomString(32, upper: false, special: false);
|
||||
await SaveUserAsync(user);
|
||||
await _eventService.LogUserEventAsync(user.Id, EventType.User_Recovered2fa);
|
||||
await _eventService.LogUserEventAsync(user.Id, _currentContext, EventType.User_Recovered2fa);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user