Enhance ForgotPassword, Login, and ResetPassword pages: add error message display and adjust heading styles
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
<div class="card-body p-4 p-md-5">
|
||||
<div class="text-center mb-4">
|
||||
<i class="fa-solid fa-leaf mb-3" style="font-size: 3rem; color: #64ae24;"></i>
|
||||
<h4 class="font-weight-bold" style="color: #533a20;"><small style="font-size: .6em;">Einarbeitungen</small> @AppSettings.Terms.Title</h4>
|
||||
<h4 class="font-weight-bold" style="color: #533a20;"><small style="font-size: .6em;" class="d-block">Einarbeitungen</small> @AppSettings.Terms.Title</h4>
|
||||
<p class="text-muted">Passwort zurücksetzen</p>
|
||||
</div>
|
||||
|
||||
@@ -27,6 +27,13 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
@if (!string.IsNullOrEmpty(ErrorMessage))
|
||||
{
|
||||
<div class="alert alert-danger text-center">
|
||||
@ErrorMessage
|
||||
</div>
|
||||
}
|
||||
|
||||
<Validation Validator="ValidationHelper.ValidateMail" @bind-Status="@IsValidMail">
|
||||
<Field>
|
||||
<FieldLabel>E-Mail Adresse</FieldLabel>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using Blazorise;
|
||||
using FoodsharingSiegen.Server.BaseClasses;
|
||||
using FoodsharingSiegen.Server.Auth;
|
||||
@@ -15,19 +16,30 @@ namespace FoodsharingSiegen.Server.Pages
|
||||
|
||||
public bool IsSubmitted { get; set; }
|
||||
public bool IsLoading { get; set; }
|
||||
public string? ErrorMessage { get; set; }
|
||||
|
||||
public async Task SubmitRequest()
|
||||
{
|
||||
if (IsValidMail != ValidationStatus.Success) return;
|
||||
|
||||
IsLoading = true;
|
||||
ErrorMessage = null;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
|
||||
await AuthService.InitiatePasswordReset(MailAddress, NavigationManager.BaseUri);
|
||||
|
||||
IsSubmitted = true;
|
||||
IsLoading = false;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
try
|
||||
{
|
||||
await AuthService.InitiatePasswordReset(MailAddress, NavigationManager.BaseUri);
|
||||
IsSubmitted = true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
ErrorMessage = "Es gab ein Problem bei der Verarbeitung der Anfrage. Bitte versuche es später erneut oder wende dich an einen Administrator.";
|
||||
}
|
||||
finally
|
||||
{
|
||||
IsLoading = false;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task TextEdit_KeyUp(KeyboardEventArgs e)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<div class="card-body p-4 p-md-5">
|
||||
<div class="text-center mb-4">
|
||||
<i class="fa-solid fa-leaf mb-3" style="font-size: 3rem; color: #64ae24;"></i>
|
||||
<h4 class="font-weight-bold" style="color: #533a20;"><small style="font-size: .6em;">Einarbeitungen</small> @AppSettings.Terms.Title</h4>
|
||||
<h4 class="font-weight-bold" style="color: #533a20;"><small style="font-size: .6em;" class="d-block">Einarbeitungen</small> @AppSettings.Terms.Title</h4>
|
||||
<p class="text-muted">Bitte melde dich an, um fortzufahren.</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<div class="card-body p-4 p-md-5">
|
||||
<div class="text-center mb-4">
|
||||
<i class="fa-solid fa-leaf mb-3" style="font-size: 3rem; color: #64ae24;"></i>
|
||||
<h4 class="font-weight-bold" style="color: #533a20;"><small style="font-size: .6em;">Einarbeitungen</small> @AppSettings.Terms.Title</h4>
|
||||
<h4 class="font-weight-bold" style="color: #533a20;"><small style="font-size: .6em;" class="d-block">Einarbeitungen</small> @AppSettings.Terms.Title</h4>
|
||||
<p class="text-muted">Neues Passwort festlegen</p>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user