139a612b6c
* Clean up repeated code * Move User cards to a reusable component * Create page for Login * Clean up Login, Register, and Change password forms * Add links to sidebar navigation * Lots of other misc. stuff
52 lines
2.8 KiB
Plaintext
52 lines
2.8 KiB
Plaintext
@inject HttpClient Client
|
|
@inject IDialogService DialogService
|
|
@inject LoginService LoginService
|
|
@inject NavigationManager NavigationManager
|
|
|
|
@page "/ChangePassword"
|
|
|
|
@if (LoginService.OnlyAdmin || !LoginService.LoginRequired)
|
|
{
|
|
NavigationManager.NavigateTo("/");
|
|
}
|
|
else
|
|
{
|
|
if (LoginService.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">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="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="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="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="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">Change password</MudButton>
|
|
</div>
|
|
</MudForm>
|
|
</MudCardContent>
|
|
</MudCard>
|
|
</MudItem>
|
|
</MudGrid>
|
|
</MudContainer>
|
|
}
|
|
else
|
|
{
|
|
NavigationManager.NavigateTo("/");
|
|
}
|
|
} |