@page "/account/manage" @using Hcs.WebApp.Services @using Microsoft.AspNetCore.Authorization @attribute [Authorize] @inject IdentityService IdentityService Профиль
@errorMessage Пароль успешно изменен Смена пароля
@code { sealed class PasswordInputModel { public string OldPassword { get; set; } = ""; public string NewPassword { get; set; } = ""; public string ConfirmNewPassword { get; set; } = ""; } bool hasError; string? errorMessage; bool hasSuccess; BusyDialog busyDialog; [SupplyParameterFromForm] PasswordInputModel PasswordInput { get; set; } = new(); async Task ChangePassword() { hasError = false; hasSuccess = false; try { busyDialog.Show(); await IdentityService.ChangePassword(PasswordInput.OldPassword, PasswordInput.NewPassword); hasSuccess = true; } catch (Exception e) { hasError = true; errorMessage = e.Message; } finally { busyDialog.Hide(); } } }