Open Closed

Force User to change password on login #464


User avatar
0
mmorrisset created

Hi, I need to setup a way to force a user to change their password on their next login. I created a flag in the user table that when set, redirects them to a custom change password page. When I call UpdatePasswordAsync() from the IdentityUserAppService, logged in as a non admin user, I get a permission error. How can I reset a users password from my own code?

Also, I see that I have asked 3 questions on here. I have only asked 1. How are you counting?

Thanks <matt>


3 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    I think you can use the IProfileAppService service. it has ChangePasswordAsync method.

    I see that I have asked 3 questions on here. I have only asked 1. How are you counting?

    I will check it out.

  • User Avatar
    0
    mmorrisset created

    Now a user can update their password. My problem now is that I can't update my "ChangePassword" flag in the user table due to permissions. How can I update a field in the user table as a non admin user?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    You can update the ChangePassword via override services. see: https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Overriding-Services

Made with ❤️ on ABP v9.1.0-preview. Updated on November 11, 2024, 11:11