@page "/reset-password/{role}" @using HealthcareManagerUI.Models @using HealthcareManagerUI.Services.Authentication @using HealthcareManagerUI.Components.Layout @layout AuthLayout @inject IAuthenticationService AuthenticationService @inject NavigationManager NavigationManager Reset your password

Register

@code { [SupplyParameterFromForm] public UserRegisterModel? userResetPasswordModel { get; set; } protected override void OnInitialized() { userResetPasswordModel ??= new(); } [Parameter] public string Role { get; set; } private string errorMessage { get; set; } private void ClearErrorMessage() { errorMessage = string.Empty; } private async Task HandleResetPassword() { var response = Role switch { "doctor" => await AuthenticationService.ResetDoctorPassword(userResetPasswordModel), "patient" => await AuthenticationService.ResetPatientPassword(userResetPasswordModel), _ => null }; if (response.StatusCode >= 200 && response.StatusCode <= 399) { NavigationManager.NavigateTo($"/login/{Role}"); } else { errorMessage = response.Message; } } }