1
0
mirror of synced 2024-12-05 03:17:58 +01:00
TaikoLocalServer/TaikoWebUI/Pages/ChangePassword.razor

52 lines
2.9 KiB
Plaintext
Raw Normal View History

2023-10-16 11:38:27 +02:00
@inject HttpClient Client
@inject IDialogService DialogService
2024-05-17 00:32:46 +02:00
@inject AuthService AuthService
2023-10-16 11:38:27 +02:00
@inject NavigationManager NavigationManager
@page "/ChangePassword"
2023-10-16 11:38:27 +02:00
2024-05-17 00:32:46 +02:00
@if (AuthService.OnlyAdmin || !AuthService.LoginRequired)
2023-10-16 11:38:27 +02:00
{
NavigationManager.NavigateTo("/");
2023-10-16 11:38:27 +02:00
}
else
{
2024-05-17 00:32:46 +02:00
if (AuthService.IsLoggedIn)
{
<MudContainer>
<MudGrid Justify="Justify.Center">
<MudItem xs="12" md="6" lg="4" class="mt-8">
<MudCard Elevation="0" Outlined="true">
<MudCardContent>
<MudForm @ref="changePasswordForm">
<MudText Typo="Typo.h5" Class="mb-4">@Localizer["Change Password"]</MudText>
<div style="display:flex;flex-direction:column;gap:15px;">
<MudTextField @bind-value="cardNum" InputType="InputType.Text" T="string"
FullWidth="true" Required="@true" RequiredError="Access code is required"
Label=@Localizer["Access Code"] Variant="Variant.Outlined" Margin="Margin.Dense" />
<MudTextField @bind-Value="oldPassword" InputType="InputType.Password"
T="string" FullWidth="true" Required="@true"
RequiredError="Old Password is required"
Label=@Localizer["Old Password"] Variant="Variant.Outlined" Margin="Margin.Dense" />
<MudTextField @bind-Value="newPassword" InputType="InputType.Password"
T="string" FullWidth="true" Required="@true"
RequiredError="Password is required"
Label=@Localizer["New Password"] Variant="Variant.Outlined" Margin="Margin.Dense" />
<MudTextField @bind-Value="confirmNewPassword" InputType="InputType.Password"
T="string" FullWidth="true" Required="@true"
RequiredError="Confirm password is required"
Label=@Localizer["Confirm New Password"] Variant="Variant.Outlined" Margin="Margin.Dense" />
<MudButton OnClick="OnChangePassword" FullWidth="true" Class="mt-3" StartIcon="@Icons.Material.Filled.Edit" Color="Color.Primary" Variant="Variant.Filled">@Localizer["Change Password"]</MudButton>
</div>
</MudForm>
</MudCardContent>
</MudCard>
</MudItem>
</MudGrid>
</MudContainer>
}
else
{
NavigationManager.NavigateTo("/");
}
2023-10-16 11:38:27 +02:00
}