Show invalid password error on login when user should change password#25482
Merged
EngincanV merged 3 commits intoJun 1, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses an ABP Identity login UX issue where users flagged with ShouldChangePasswordOnNextLogin always got a NotAllowed result before password verification, making the UI show the same “not allowed” warning for both correct and incorrect passwords.
Changes:
- Added an ASP.NET Core identity integration test asserting
PasswordSignInAsyncreturnsNotAllowedfor users required to change password, regardless of password correctness. - Updated the Razor Pages login flow to re-check the password when
PasswordSignInAsyncreturnsNotAllowed, surfacingInvalidUserNameOrPasswordwhen the password is incorrect.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| modules/identity/test/Volo.Abp.Identity.AspNetCore.Tests/Volo/Abp/Identity/AspNetCore/AbpSignInManager_Tests.cs | Adds coverage for the NotAllowed-regardless-of-password behavior when ShouldChangePasswordOnNextLogin is true. |
| modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs | Re-checks password after NotAllowed to show an “invalid credentials” error when appropriate. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## rel-10.4 #25482 +/- ##
============================================
- Coverage 49.42% 49.41% -0.01%
============================================
Files 3670 3670
Lines 123599 123599
Branches 9453 9453
============================================
- Hits 61083 61073 -10
- Misses 60682 60690 +8
- Partials 1834 1836 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…d oracle on other NotAllowed branches
1 task
EngincanV
approved these changes
Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #25481.
When
ShouldChangePasswordOnNextLoginistrue,AbpSignInManager.PreSignInCheckrejects the sign-in before the password is verified, soPasswordSignInAsyncreturnsNotAllowedfor both right and wrong passwords. The Login page used to showLoginIsNotAllowedfor both cases, leaving users with a wrong password unable to tell their credentials were invalid.The Login page now re-checks the password under the user's tenant only when the user has
ShouldChangePasswordOnNextLoginorShouldPeriodicallyChangePasswordAsyncset, and surfacesInvalidUserNameOrPasswordif the password is wrong. OtherNotAllowedreasons (inactive, unconfirmed, etc.) keep the existing genericLoginIsNotAllowedwarning to avoid turning them into a password oracle.