1
0
mirror of https://github.com/bitwarden/server synced 2025-12-22 19:23:45 +00:00

Add event types

This commit is contained in:
Kyle Spearrin
2019-06-20 08:56:10 -04:00
parent e242539b84
commit 69731ecb9d
2 changed files with 14 additions and 2 deletions

View File

@@ -39,11 +39,16 @@ namespace Bit.Events.Controllers
switch(model.Type)
{
// User events
case EventType.User_LoggedIn:
case EventType.User_ExportedVault:
await _eventService.LogUserEventAsync(_currentContext.UserId.Value, model.Type);
break;
// Cipher events
case EventType.Cipher_Created:
case EventType.Cipher_ClientAutofilled:
case EventType.Cipher_ClientCopedHiddenField:
case EventType.Cipher_ClientCopiedPassword:
case EventType.Cipher_ClientToggledHiddenFieldVisible:
case EventType.Cipher_ClientToggledPasswordVisible:
case EventType.Cipher_ClientViewed:
if(!model.CipherId.HasValue)
{
return new BadRequestResult();