Error message on invalid credentials
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using Blazorise;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
|
||||
@@ -26,9 +25,9 @@ namespace FoodsharingSiegen.Server.Pages
|
||||
#region Private Properties
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value of the mailaddress (ab)
|
||||
/// Gets or sets the value of the mail-address (ab)
|
||||
/// </summary>
|
||||
private string? Mailaddress { get; set; }
|
||||
private string? MailAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value of the password (ab)
|
||||
@@ -46,18 +45,22 @@ namespace FoodsharingSiegen.Server.Pages
|
||||
{
|
||||
//Todo Eingaben Validieren [04.04.22 - Andre Beging]
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Mailaddress) || string.IsNullOrWhiteSpace(Password))
|
||||
if (string.IsNullOrWhiteSpace(MailAddress) || string.IsNullOrWhiteSpace(Password))
|
||||
{
|
||||
Mailaddress = string.Empty;
|
||||
MailAddress = string.Empty;
|
||||
Password = string.Empty;
|
||||
return;
|
||||
}
|
||||
|
||||
var loginR = await AuthService.Login(Mailaddress, Password);
|
||||
var loginR = await AuthService.Login(MailAddress, Password);
|
||||
if (loginR.Success)
|
||||
{
|
||||
NavigationManager.NavigateTo("/", true);
|
||||
}
|
||||
else
|
||||
{
|
||||
await Notification?.Error(loginR.ErrorMessage)!;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user