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

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