1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-05 10:02:47 -05:00

[Bug] Skip WebAuthn 2fa event logs during login flow (#1978)

* [Bug] Supress WebAuthn 2fa event logs during login process

* Formatting

* Simplified method call with new paramter input
This commit is contained in:
Vincent Salucci
2022-04-28 16:42:47 -05:00
committed by GitHub
parent a7a45893a3
commit 8b1a6b4ad3
3 changed files with 8 additions and 5 deletions

View File

@ -879,11 +879,14 @@ namespace Bit.Core.Services
return IdentityResult.Failed(_identityErrorDescriber.PasswordMismatch());
}
public async Task UpdateTwoFactorProviderAsync(User user, TwoFactorProviderType type, bool setEnabled = true)
public async Task UpdateTwoFactorProviderAsync(User user, TwoFactorProviderType type, bool setEnabled = true, bool logEvent = true)
{
SetTwoFactorProvider(user, type, setEnabled);
await SaveUserAsync(user);
await _eventService.LogUserEventAsync(user.Id, EventType.User_Updated2fa);
if (logEvent)
{
await _eventService.LogUserEventAsync(user.Id, EventType.User_Updated2fa);
}
}
public async Task DisableTwoFactorProviderAsync(User user, TwoFactorProviderType type,