Skip to content

Commit

Permalink
PT-14407: The attempt counter does not reset when logging in
Browse files Browse the repository at this point in the history
fix: The attempt counter does not reset when logging in
  • Loading branch information
OlegoO committed Nov 17, 2023
1 parent 45bd639 commit 8edd99e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions VirtoCommerce.Storefront/Controllers/AccountController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,11 @@ private async Task SignOutAndSignInAsync(User user)
await SetLastLoginDate(user);
}

private async Task SetLastLoginDate(User user)
private Task SetLastLoginDate(User user)
{
user.LastLoginDate = DateTime.UtcNow;
await _signInManager.UserManager.UpdateAsync(user);
user.AccessFailedCount = 0;
return _signInManager.UserManager.UpdateAsync(user);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -528,10 +528,11 @@ private async Task<NotificationSendResult> SendNotificationAsync(NotificationBas
return result;
}

private async Task SetLastLoginDate(User user)
private Task SetLastLoginDate(User user)
{
user.LastLoginDate = DateTime.UtcNow;
await _signInManager.UserManager.UpdateAsync(user);
user.AccessFailedCount = 0;
return _signInManager.UserManager.UpdateAsync(user);
}

// GET: storefrontapi/account/passwordrequirements
Expand Down

0 comments on commit 8edd99e

Please sign in to comment.