Open Closed

Reset password without providing old password #5908


User avatar
0
lalitChougule created
  • ABP Framework version: v7.2.2
  • UI Type: Angular
  • Database System: EF Core PostgreSQL
  • Tiered (for MVC) or Auth Server Separated (for Angular): no/yes
  • Exception message and full stack trace: N.A
  • Steps to reproduce the issue:

I have a requirement where I have create few users using SQL scripts. For these users I need to share URL via email to reset password.

I found this method as per my use case in AccountAppService

public virtual async Task ResetPasswordAsync(ResetPasswordDto input)
{
    await IdentityOptions.SetAsync();

    var user = await UserManager.GetByIdAsync(input.UserId);
    (await UserManager.ResetPasswordAsync(user, input.ResetToken, input.Password)).CheckErrors();

    await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext
    {
        Identity = IdentitySecurityLogIdentityConsts.Identity,
        Action = IdentitySecurityLogActionConsts.ChangePassword
    });
}

I need to know what do I pass into ResetToken ? And how to generate this Reset Token ?

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

    var resetToken = await UserManager.GeneratePasswordResetTokenAsync(user);
    
    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 September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.