Пример #1
0
    protected async Task ChangePasswordAsync()
    {
        if (string.IsNullOrWhiteSpace(ChangePasswordModel.CurrentPassword))
        {
            return;
        }

        if (ChangePasswordModel.NewPassword != ChangePasswordModel.NewPasswordConfirm)
        {
            await UiMessageService.Warn(L["NewPasswordConfirmFailed"]);

            return;
        }

        await ProfileAppService.ChangePasswordAsync(new ChangePasswordInput
        {
            CurrentPassword = ChangePasswordModel.CurrentPassword,
            NewPassword     = ChangePasswordModel.NewPassword
        });

        ChangePasswordModel.Clear();

        await UiMessageService.Success(L["PasswordChanged"]);
    }