TShockAPI.DB.UserManager.SetUserPassword C# (CSharp) Method

SetUserPassword() public method

Sets the Hashed Password for a given username
public SetUserPassword ( User user, string password ) : void
user User User user
password string string password
return void
        public void SetUserPassword(User user, string password)
        {
            try
            {
                user.CreateBCryptHash(password);

                if (
                    _database.Query("UPDATE Users SET Password = @0 WHERE Username = @1;", user.Password,
                        user.Name) == 0)
                    throw new UserNotExistException(user.Name);
            }
            catch (Exception ex)
            {
                throw new UserManagerException("SetUserPassword SQL returned an error", ex);
            }
        }