37 lines
1.0 KiB
Plaintext
37 lines
1.0 KiB
Plaintext
@page "/login"
|
|
@layout EmptyLayout
|
|
@attribute [AllowAnonymous]
|
|
@using Flypaper.Web.Auth
|
|
@inject AdminAuthenticator Admin
|
|
@inject NavigationManager Navigation
|
|
|
|
<PageTitle>Flypaper · Anmelden</PageTitle>
|
|
|
|
<h1 class="login-title">Flypaper</h1>
|
|
|
|
<form method="post" action="/auth/login" class="card form">
|
|
<AntiforgeryToken />
|
|
<input type="hidden" name="returnUrl" value="@ReturnUrl" />
|
|
<label for="password">Passwort</label>
|
|
<input id="password" name="password" type="password" autocomplete="current-password" autofocus required />
|
|
@if (Error is not null)
|
|
{
|
|
<p class="error">Passwort falsch.</p>
|
|
}
|
|
<button type="submit">Anmelden</button>
|
|
</form>
|
|
|
|
@code {
|
|
[SupplyParameterFromQuery(Name = "error")] private string? Error { get; set; }
|
|
|
|
[SupplyParameterFromQuery(Name = "returnUrl")] private string? ReturnUrl { get; set; }
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
if (!await Admin.IsConfiguredAsync())
|
|
{
|
|
Navigation.NavigateTo("/setup");
|
|
}
|
|
}
|
|
}
|