Browse Source
Merge pull request #17362 from abpframework/issue-17361
Correctly output `security logs` in `OpenIddict's` controller.
pull/17363/head
liangshiwei
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
8 additions and
8 deletions
-
modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.Password.cs
|
|
|
@ -96,6 +96,14 @@ public partial class TokenController |
|
|
|
var result = await SignInManager.CheckPasswordSignInAsync(user, request.Password, true); |
|
|
|
if (!result.Succeeded) |
|
|
|
{ |
|
|
|
await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext |
|
|
|
{ |
|
|
|
Identity = OpenIddictSecurityLogIdentityConsts.OpenIddict, |
|
|
|
Action = result.ToIdentitySecurityLogAction(), |
|
|
|
UserName = request.Username, |
|
|
|
ClientId = request.ClientId |
|
|
|
}); |
|
|
|
|
|
|
|
string errorDescription; |
|
|
|
if (result.IsLockedOut) |
|
|
|
{ |
|
|
|
@ -138,14 +146,6 @@ public partial class TokenController |
|
|
|
return await HandleTwoFactorLoginAsync(request, user); |
|
|
|
} |
|
|
|
|
|
|
|
await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext |
|
|
|
{ |
|
|
|
Identity = OpenIddictSecurityLogIdentityConsts.OpenIddict, |
|
|
|
Action = result.ToIdentitySecurityLogAction(), |
|
|
|
UserName = request.Username, |
|
|
|
ClientId = request.ClientId |
|
|
|
}); |
|
|
|
|
|
|
|
return await SetSuccessResultAsync(request, user); |
|
|
|
} |
|
|
|
} |
|
|
|
|