Open Closed

Users can access the application without confirming their email when a password change is required at next login #10930


User avatar
0
VMPProgramador created

During a normal sign-in, ABP checks whether the user's email has been confirmed and redirects them to the confirmation page if it hasn't. However, when a password change is required, the user is prompted to change their password first. After changing it, the user is signed in and can access the application without being asked to confirm their email. The confirmation check only takes place at the next sign-in.

Steps to reproduce

  1. Enable Abp.Identity.SignIn.RequireConfirmedEmail.
  2. Create a user with both Send confirmation email and Force password change enabled.
  3. Sign in as that user and change the password when prompted.
  4. Confirm that the user can access the application without having confirmed their email.
  5. Sign out and sign in again. The user is then prompted to confirm their email.
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Hi,

    After a forced password change, the change password page signs the user in directly and skips the email confirmation check that the normal login does.

    You can use this workaround for now. Add this class to your AuthServer project:

    using System.Threading.Tasks;
    using Volo.Abp.Account.Public.Web.Pages.Account;
    using Volo.Abp.DependencyInjection;
    using Volo.Abp.Identity;
    using Volo.Abp.Security.Claims;
    
    namespace YourProjectName.Pages.Account;
    
    [Dependency(ReplaceServices = true)]
    [ExposeServices(typeof(ChangePasswordModel))]
    public class MyChangePasswordModel : ChangePasswordModel
    {
        public MyChangePasswordModel(ICurrentPrincipalAccessor currentPrincipalAccessor)
            : base(currentPrincipalAccessor)
        {
        }
    
        protected override async Task<bool> ShouldRequireForcedTwoFactorConfirmationAsync(IdentityUser user)
        {
            return !await SignInManager.CanSignInAsync(user)
                || await base.ShouldRequireForcedTwoFactorConfirmationAsync(user);
        }
    }
    

    It checks the email confirmation before the user is signed in, so a user who hasn't confirmed their email is sent to the confirmation page after changing the password.

    We'll fix this in the next patch release. Your ticket has been refunded.

    Thanks

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on November 02, 2026, 06:56
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.