From 37349371a87af83778d901aecbe24de87ccf6c54 Mon Sep 17 00:00:00 2001 From: maliming Date: Wed, 3 Dec 2025 11:31:51 +0800 Subject: [PATCH] Refactor PasswordSignInAsync and add CallPreSignInCheckAsync method for enhanced pre-sign-in validation --- .../Abp/Identity/AspNetCore/AbpSignInManager.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/identity/src/Volo.Abp.Identity.AspNetCore/Volo/Abp/Identity/AspNetCore/AbpSignInManager.cs b/modules/identity/src/Volo.Abp.Identity.AspNetCore/Volo/Abp/Identity/AspNetCore/AbpSignInManager.cs index 90b39e9953..a68849dc28 100644 --- a/modules/identity/src/Volo.Abp.Identity.AspNetCore/Volo/Abp/Identity/AspNetCore/AbpSignInManager.cs +++ b/modules/identity/src/Volo.Abp.Identity.AspNetCore/Volo/Abp/Identity/AspNetCore/AbpSignInManager.cs @@ -45,7 +45,7 @@ public class AbpSignInManager : SignInManager _identityUserManager = userManager; } - public async override Task PasswordSignInAsync( + public override async Task PasswordSignInAsync( string userName, string password, bool isPersistent, @@ -89,7 +89,17 @@ public class AbpSignInManager : SignInManager return await base.PasswordSignInAsync(userName, password, isPersistent, lockoutOnFailure); } - protected async override Task PreSignInCheck(IdentityUser user) + /// + /// This is to call the protection method PreSignInCheck + /// + /// The user + /// Null if the user should be allowed to sign in, otherwise the SignInResult why they should be denied. + public virtual async Task CallPreSignInCheckAsync(IdentityUser user) + { + return await base.PreSignInCheck(user); + } + + protected override async Task PreSignInCheck(IdentityUser user) { if (!user.IsActive) {