Login Page
This commit is contained in:
@@ -1,29 +1,26 @@
|
||||
@page "/login"
|
||||
@using FoodsharingSiegen.Server.Service
|
||||
@using FoodsharingSiegen.Server.Auth
|
||||
@layout LoginLayout
|
||||
|
||||
@inject AuthService AuthService
|
||||
@inject NavigationManager NavigationManager
|
||||
|
||||
@code
|
||||
{
|
||||
private string? Mailaddress { get; set; }
|
||||
<div class="d-flex justify-content-center align-items-center" style="height: 100vh;">
|
||||
<div class="card" style="width: 100%; max-width: 380px;">
|
||||
<div class="card-header">FS Siegen</div>
|
||||
<div class="card-body">
|
||||
<Validation Validator="ValidateMail" @bind-Status="@IsValidMail">
|
||||
<TextEdit @bind-Text="Mailaddress" Role="TextRole.Email" Placeholder="E-Mail" Class="mt-0" KeyUp="TextEdit_KeyUp"></TextEdit>
|
||||
</Validation>
|
||||
|
||||
private string? Password { get; set; }
|
||||
<Validation Validator="ValidatePassword" @bind-Status="@IsValidPassword">
|
||||
<TextEdit @bind-Text="Password" Role="TextRole.Password" Placeholder="Passwort" Class="my-3" KeyUp="TextEdit_KeyUp"></TextEdit>
|
||||
</Validation>
|
||||
|
||||
private async Task PerformLogin()
|
||||
{
|
||||
//Todo Eingaben Validieren [04.04.22 - Andre Beging]
|
||||
|
||||
var loginR = await AuthService.Login(Mailaddress, Password);
|
||||
if (loginR.Success)
|
||||
{
|
||||
NavigationManager.NavigateTo("/", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
<div class="d-flex justify-content-center">
|
||||
<Button Clicked="PerformLogin" Disabled="@(IsValidMail != ValidationStatus.Success || IsValidPassword != ValidationStatus.Success)">Einloggen</Button>
|
||||
</div>
|
||||
|
||||
<TextEdit @bind-Text="Mailaddress" Placeholder="Mail"></TextEdit>
|
||||
<TextEdit @bind-Text="Password" Placeholder="Password"></TextEdit>
|
||||
<Button Clicked="PerformLogin">Go</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user