finished admin login

This commit is contained in:
2024-11-19 18:20:27 +01:00
parent 61323f089d
commit 4801e790c0
7 changed files with 20 additions and 31 deletions

View File

@@ -12,29 +12,10 @@
<PageTitle>Login</PageTitle>
<div class="login-wrapper">
@*<EditForm Model="UserLogin" OnValidSubmit="Login" FormName="login-form">
<div class="field-wrapper">
<h3>Login</h3>
<div class="mb-3">
<BSLabel>E-Mail address</BSLabel>
<InputText type="email" class="form-control" required @bind-Value="UserLogin.Email"/>
</div>
<div class="mb-3">
<BSLabel>Password</BSLabel>
<InputText type="password" class="form-control" required @bind-Value="UserLogin.Password"/>
</div>
<BSButton Color="BSColor.Primary" IsSubmit="true">Login</BSButton>
@if (_hasError) {
<BSAlert Color="BSColor.Danger" style="margin-top: 16px; margin-bottom: 0">Email or password does not match any account!</BSAlert>
}
</div>
</EditForm>*@
<div id="login-card">
<span id="login-title">HopFrame Administration</span>
<span id="login-subtitle">Login to proceed</span>
<EditForm Model="UserLogin" OnInvalidSubmit="Login" FormName="login-form" style="display: flex; flex-grow: 1; flex-direction: column">
<EditForm Model="UserLogin" OnValidSubmit="Login" FormName="login-form" style="display: flex; flex-grow: 1; flex-direction: column">
<div class="mb-3">
<BSLabel>E-Mail address</BSLabel>
<InputText type="email" class="form-control" required @bind-Value="UserLogin.Email"/>
@@ -76,7 +57,7 @@
}
}
private async Task Login() { //TODO: Login does not work
private async Task Login() {
var result = await Auth.Login(UserLogin);
if (!result) {
@@ -84,6 +65,6 @@
return;
}
Navigator.NavigateTo(string.IsNullOrEmpty(RedirectAfter) ? DefaultRedirect : RedirectAfter, true);
Navigator.NavigateTo(string.IsNullOrEmpty(RedirectAfter) ? DefaultRedirect : "/administration/" + RedirectAfter, true);
}
}