finalizare 1.0

This commit is contained in:
andrei-mihnea-cerbu
2024-05-21 12:10:53 +03:00
parent f7795f7519
commit 1cc1d34003
11268 changed files with 2102399 additions and 10909 deletions
@@ -0,0 +1,44 @@
@page "/reset-password"
@inject IAuthenticationService AuthenticationService
@inject NavigationManager Navigation
@layout AuthLayout
<h3>Reset Password</h3>
@if (!string.IsNullOrEmpty(_errorMessage))
{
<div class="alert alert-danger mt-2">@_errorMessage</div>
}
<EditForm Model="_resetPasswordModel" OnValidSubmit="HandleResetPassword">
<div class="form-group">
<label>Email:</label>
<InputText class="form-control" @bind-Value="_resetPasswordModel.Email"/>
</div>
<div class="form-group">
<label>New Password:</label>
<InputText class="form-control" @bind-Value="_resetPasswordModel.Password" type="password"/>
</div>
<button type="submit" class="btn btn-primary">Reset Password</button>
</EditForm>
@code {
private readonly ResetPasswordModel _resetPasswordModel = new();
private string _errorMessage = string.Empty;
private async Task HandleResetPassword()
{
_errorMessage = string.Empty;
var response = await AuthenticationService.ResetPassword(_resetPasswordModel);
if (response.StatusCode == 200)
{
Navigation.NavigateTo("/login", true);
}
else
{
_errorMessage = response.Message; // Display error message
}
}
}