Change Password

Make sure your application has been initialized before attempting to change a user password.

Winforms
private async void btnChangePass_Click(object sender, EventArgs e)
{
var resetResponse = await FusionApp.ResetPassword(tbOldPass.Text, tbNewPass.Text);
if (resetResponse.Error == false)
{
MessageBox.Show(resetResponse.Message, "FusionAPI.dev");
}
else
{
MessageBox.Show(resetResponse.Message, "FusionAPI.dev");
}
}
Console
static async void Main(string[] args)
{
Console.Title = "FusionAPI.dev";
Console.Write("Enter your old password: ");
string oldpassword = Console.ReadLine();
Console.Write("Enter your new password: ");
string newpassword = Console.ReadLine();
var resetResponse = await FusionApp.ResetPassword(oldpassword, newpassword);
if (resetResponse.Error == false)
{
// Password was changed
Console.WriteLine(resetResponse.Message);
}
else
{
// Password was not changed
Console.WriteLine(resetResponse.Message);
}
}