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="card-body p-4 p-md-5">
|
||||||
<div class="text-center mb-4">
|
<div class="text-center mb-4">
|
||||||
<i class="fa-solid fa-leaf mb-3" style="font-size: 3rem; color: #64ae24;"></i>
|
<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>
|
<p class="text-muted">Passwort zurücksetzen</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -27,6 +27,13 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@if (!string.IsNullOrEmpty(ErrorMessage))
|
||||||
|
{
|
||||||
|
<div class="alert alert-danger text-center">
|
||||||
|
@ErrorMessage
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
<Validation Validator="ValidationHelper.ValidateMail" @bind-Status="@IsValidMail">
|
<Validation Validator="ValidationHelper.ValidateMail" @bind-Status="@IsValidMail">
|
||||||
<Field>
|
<Field>
|
||||||
<FieldLabel>E-Mail Adresse</FieldLabel>
|
<FieldLabel>E-Mail Adresse</FieldLabel>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using System;
|
||||||
using Blazorise;
|
using Blazorise;
|
||||||
using FoodsharingSiegen.Server.BaseClasses;
|
using FoodsharingSiegen.Server.BaseClasses;
|
||||||
using FoodsharingSiegen.Server.Auth;
|
using FoodsharingSiegen.Server.Auth;
|
||||||
@@ -15,19 +16,30 @@ namespace FoodsharingSiegen.Server.Pages
|
|||||||
|
|
||||||
public bool IsSubmitted { get; set; }
|
public bool IsSubmitted { get; set; }
|
||||||
public bool IsLoading { get; set; }
|
public bool IsLoading { get; set; }
|
||||||
|
public string? ErrorMessage { get; set; }
|
||||||
|
|
||||||
public async Task SubmitRequest()
|
public async Task SubmitRequest()
|
||||||
{
|
{
|
||||||
if (IsValidMail != ValidationStatus.Success) return;
|
if (IsValidMail != ValidationStatus.Success) return;
|
||||||
|
|
||||||
IsLoading = true;
|
IsLoading = true;
|
||||||
|
ErrorMessage = null;
|
||||||
await InvokeAsync(StateHasChanged);
|
await InvokeAsync(StateHasChanged);
|
||||||
|
|
||||||
await AuthService.InitiatePasswordReset(MailAddress, NavigationManager.BaseUri);
|
try
|
||||||
|
{
|
||||||
IsSubmitted = true;
|
await AuthService.InitiatePasswordReset(MailAddress, NavigationManager.BaseUri);
|
||||||
IsLoading = false;
|
IsSubmitted = true;
|
||||||
await InvokeAsync(StateHasChanged);
|
}
|
||||||
|
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)
|
public async Task TextEdit_KeyUp(KeyboardEventArgs e)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<div class="card-body p-4 p-md-5">
|
<div class="card-body p-4 p-md-5">
|
||||||
<div class="text-center mb-4">
|
<div class="text-center mb-4">
|
||||||
<i class="fa-solid fa-leaf mb-3" style="font-size: 3rem; color: #64ae24;"></i>
|
<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>
|
<p class="text-muted">Bitte melde dich an, um fortzufahren.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<div class="card-body p-4 p-md-5">
|
<div class="card-body p-4 p-md-5">
|
||||||
<div class="text-center mb-4">
|
<div class="text-center mb-4">
|
||||||
<i class="fa-solid fa-leaf mb-3" style="font-size: 3rem; color: #64ae24;"></i>
|
<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>
|
<p class="text-muted">Neues Passwort festlegen</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user