Auth System
This commit is contained in:
29
FoodsharingSiegen.Server/Pages/Login.razor
Normal file
29
FoodsharingSiegen.Server/Pages/Login.razor
Normal file
@@ -0,0 +1,29 @@
|
||||
@page "/login"
|
||||
@using FoodsharingSiegen.Server.Service
|
||||
@using FoodsharingSiegen.Server.Auth
|
||||
@layout LoginLayout
|
||||
|
||||
@inject AuthService AuthService
|
||||
@inject NavigationManager NavigationManager
|
||||
|
||||
@code
|
||||
{
|
||||
private string? Mailaddress { get; set; }
|
||||
|
||||
private string? Password { get; set; }
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<TextEdit @bind-Text="Mailaddress" Placeholder="Mail"></TextEdit>
|
||||
<TextEdit @bind-Text="Password" Placeholder="Password"></TextEdit>
|
||||
<Button Clicked="PerformLogin">Go</Button>
|
||||
Reference in New Issue
Block a user