2023-10-16 11:38:27 +02:00
|
|
|
@inject HttpClient Client
|
|
|
|
@inject IDialogService DialogService
|
|
|
|
@inject LoginService LoginService
|
|
|
|
@inject NavigationManager NavigationManager
|
|
|
|
|
2023-11-11 22:04:11 +01:00
|
|
|
@page "/Users/ChangePassword"
|
2023-10-16 11:38:27 +02:00
|
|
|
|
2023-11-11 22:04:11 +01:00
|
|
|
<h1>Users</h1>
|
2023-10-16 11:38:27 +02:00
|
|
|
|
|
|
|
@if (LoginService.OnlyAdmin || !LoginService.LoginRequired)
|
|
|
|
{
|
|
|
|
<h1>Changing password is turned off</h1>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
<MudContainer>
|
|
|
|
<MudGrid Justify="Justify.Center">
|
2023-11-13 14:15:45 +01:00
|
|
|
<MudItem xs="12" md="6" lg="4" class="mt-8">
|
2023-10-16 11:38:27 +02:00
|
|
|
<MudCard>
|
|
|
|
<MudCardContent>
|
|
|
|
<MudForm @ref="changePasswordForm">
|
|
|
|
<MudText Typo="Typo.h4" Align="Align.Center">Change Password</MudText>
|
|
|
|
<MudTextField @bind-value="cardNum" InputType="InputType.Text" T="string"
|
2023-11-13 14:15:45 +01:00
|
|
|
FullWidth="true" Required="@true" RequiredError="Access code is required"
|
|
|
|
Label="Access Code"/>
|
2023-10-16 11:38:27 +02:00
|
|
|
<MudTextField @bind-Value="oldPassword" InputType="InputType.Password"
|
|
|
|
T="string" FullWidth="true" Required="@true"
|
|
|
|
RequiredError="Old Password is required"
|
|
|
|
Label="Old Password">
|
|
|
|
</MudTextField>
|
|
|
|
<MudTextField @bind-Value="newPassword" InputType="InputType.Password"
|
|
|
|
T="string" FullWidth="true" Required="@true"
|
|
|
|
RequiredError="Password is required"
|
|
|
|
Label="New Password">
|
|
|
|
</MudTextField>
|
|
|
|
<MudTextField @bind-Value="confirmNewPassword" InputType="InputType.Password"
|
|
|
|
T="string" FullWidth="true" Required="@true"
|
|
|
|
RequiredError="Confirm password is required"
|
|
|
|
Label="Confirm New Password">
|
|
|
|
</MudTextField>
|
2023-10-21 13:33:00 +02:00
|
|
|
<MudButton OnClick="OnChangePassword" FullWidth="true" Class="mt-3" StartIcon="@Icons.Material.Filled.Edit" Color="Color.Primary" Variant="Variant.Filled">Change password</MudButton>
|
2023-10-16 11:38:27 +02:00
|
|
|
</MudForm>
|
|
|
|
</MudCardContent>
|
|
|
|
</MudCard>
|
|
|
|
</MudItem>
|
|
|
|
</MudGrid>
|
|
|
|
</MudContainer>
|
|
|
|
}
|