Skip to content

Show invalid password error on login when user should change password#25482

Merged
EngincanV merged 3 commits into
rel-10.4from
maliming/login-invalid-password-when-should-change
Jun 1, 2026
Merged

Show invalid password error on login when user should change password#25482
EngincanV merged 3 commits into
rel-10.4from
maliming/login-invalid-password-when-should-change

Conversation

@maliming

@maliming maliming commented May 27, 2026

Copy link
Copy Markdown
Member

Fix #25481.

When ShouldChangePasswordOnNextLogin is true, AbpSignInManager.PreSignInCheck rejects the sign-in before the password is verified, so PasswordSignInAsync returns NotAllowed for both right and wrong passwords. The Login page used to show LoginIsNotAllowed for 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 ShouldChangePasswordOnNextLogin or ShouldPeriodicallyChangePasswordAsync set, and surfaces InvalidUserNameOrPassword if the password is wrong. Other NotAllowed reasons (inactive, unconfirmed, etc.) keep the existing generic LoginIsNotAllowed warning to avoid turning them into a password oracle.

Copilot AI review requested due to automatic review settings May 27, 2026 00:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 PasswordSignInAsync returns NotAllowed for users required to change password, regardless of password correctness.
  • Updated the Razor Pages login flow to re-check the password when PasswordSignInAsync returns NotAllowed, surfacing InvalidUserNameOrPassword when 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

codecov Bot commented May 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.41%. Comparing base (868c729) to head (f8772d2).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

@EngincanV EngincanV merged commit 57dd4d9 into rel-10.4 Jun 1, 2026
3 of 4 checks passed
@EngincanV EngincanV deleted the maliming/login-invalid-password-when-should-change branch June 1, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants