From 388d660e110a0b2aed9c068075c18a693712722f Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Fri, 15 Sep 2017 15:12:40 +0200 Subject: [PATCH] Raise event when login succeeds after 2FA challenge. Raise event when locked out during 2FA attempts. --- src/Umbraco.Web/Editors/AuthenticationController.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web/Editors/AuthenticationController.cs b/src/Umbraco.Web/Editors/AuthenticationController.cs index 452616abe3..2b6b3d8363 100644 --- a/src/Umbraco.Web/Editors/AuthenticationController.cs +++ b/src/Umbraco.Web/Editors/AuthenticationController.cs @@ -289,13 +289,20 @@ namespace Umbraco.Web.Editors } var result = await SignInManager.TwoFactorSignInAsync(model.Provider, model.Code, isPersistent: true, rememberBrowser: false); + + //get the user + var user = Security.GetBackOfficeUser(userName); switch (result) { case SignInStatus.Success: - //get the user - var user = Security.GetBackOfficeUser(userName); + if (UserManager != null) + UserManager.RaiseLoginSuccessEvent(user.Id); + return SetPrincipalAndReturnUserDetail(user); case SignInStatus.LockedOut: + if (UserManager != null) + UserManager.RaiseAccountLockedEvent(user.Id); + return Request.CreateValidationErrorResponse("User is locked out"); case SignInStatus.Failure: default: