Base solution for your next web application
BLACK FRIDAY
From Nov 21
To Dec 1
XXDAYS : XXHRS : XXMIN : XXSEC
SAVE UP TO$3K
Also valid for the
existing customers!
Open Closed

How to change the admin password #807


0
ofir1234 created

Hi. Is there an easy way to change the admin password via code ? I tried resolving the UserManager and then changing the password for user no 1, like this :

await _userManager.ChangePasswordAsync(1, "123qwe","blabla");

But the password is still the same. So how can I do it ?

Thanks.


3 Answer(s)
  • 0
    ismcagdas created
    Support Team

    Hi,

    This is the right way actually. Can you get the return value of this method and see if there is an error message ?

    var result = await _userManager.ChangePasswordAsync(1, "123qwe", "blabla");
    
  • 0
    ofir1234 created

    Any other way to change the admin password ? I just need to change it.

  • 0
    ismcagdas created
    Support Team

    Hi,

    Can you get the result of ChangePasswordAsync method and see if there is an error ?

    var result = await _userManager.ChangePasswordAsync(1, "123qwe","blabla");