Browse Source
Merge pull request #13851 from abpframework/auto-merge/rel-6-0/1315
Merge branch dev with rel-6.0
pull/13858/head
maliming
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
23 additions and
3 deletions
-
modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/AbpOpenIdDictControllerBase.cs
-
modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.AuthorizationCode.cs
-
modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.DeviceCode.cs
-
modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.RefreshToken.cs
|
|
|
@ -73,4 +73,24 @@ public abstract class AbpOpenIdDictControllerBase : AbpController |
|
|
|
|
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
protected virtual async Task<bool> PreSignInCheckAsync(IdentityUser user) |
|
|
|
{ |
|
|
|
if (!user.IsActive) |
|
|
|
{ |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
if (!await SignInManager.CanSignInAsync(user)) |
|
|
|
{ |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
if (await UserManager.IsLockedOutAsync(user)) |
|
|
|
{ |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -33,7 +33,7 @@ public partial class TokenController |
|
|
|
} |
|
|
|
|
|
|
|
// Ensure the user is still allowed to sign in.
|
|
|
|
if (!await SignInManager.CanSignInAsync(user)) |
|
|
|
if (!await PreSignInCheckAsync(user)) |
|
|
|
{ |
|
|
|
return Forbid( |
|
|
|
authenticationSchemes: OpenIddictServerAspNetCoreDefaults.AuthenticationScheme, |
|
|
|
|
|
|
|
@ -33,7 +33,7 @@ public partial class TokenController |
|
|
|
} |
|
|
|
|
|
|
|
// Ensure the user is still allowed to sign in.
|
|
|
|
if (!await SignInManager.CanSignInAsync(user)) |
|
|
|
if (!await PreSignInCheckAsync(user)) |
|
|
|
{ |
|
|
|
return Forbid( |
|
|
|
authenticationSchemes: OpenIddictServerAspNetCoreDefaults.AuthenticationScheme, |
|
|
|
|
|
|
|
@ -33,7 +33,7 @@ public partial class TokenController |
|
|
|
} |
|
|
|
|
|
|
|
// Ensure the user is still allowed to sign in.
|
|
|
|
if (!await SignInManager.CanSignInAsync(user)) |
|
|
|
if (!await PreSignInCheckAsync(user)) |
|
|
|
{ |
|
|
|
return Forbid( |
|
|
|
authenticationSchemes: OpenIddictServerAspNetCoreDefaults.AuthenticationScheme, |
|
|
|
|