Enhance ForgotPassword, Login, and ResetPassword pages: add error message display and adjust heading styles

This commit is contained in:
a.beging@eas-solutions.de
2026-04-23 07:38:08 +02:00
parent 8262c4979b
commit def8702489
4 changed files with 27 additions and 8 deletions

View File

@@ -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>

View File

@@ -1,3 +1,4 @@
using System;
using Blazorise;
using FoodsharingSiegen.Server.BaseClasses;
using FoodsharingSiegen.Server.Auth;
@@ -15,20 +16,31 @@ 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);
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)
{

View File

@@ -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>

View File

@@ -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>