37 lines
1.3 KiB
Plaintext
37 lines
1.3 KiB
Plaintext
@page "/setup"
|
|
@layout EmptyLayout
|
|
@attribute [AllowAnonymous]
|
|
@using Flypaper.Web.Auth
|
|
@inject AdminAuthenticator Admin
|
|
@inject NavigationManager Navigation
|
|
|
|
<PageTitle>Flypaper · Einrichten</PageTitle>
|
|
|
|
<h1 class="login-title">Flypaper einrichten</h1>
|
|
|
|
<form method="post" action="/auth/setup" class="card form">
|
|
<AntiforgeryToken />
|
|
<p class="muted">Lege das Admin-Passwort für das Dashboard fest. Diese Seite ist nur erreichbar, solange noch kein Passwort existiert.</p>
|
|
<label for="password">Passwort <span class="muted">(mindestens @AdminAuthenticator.MinimumPasswordLength Zeichen)</span></label>
|
|
<input id="password" name="password" type="password" autocomplete="new-password" minlength="@AdminAuthenticator.MinimumPasswordLength" autofocus required />
|
|
<label for="confirmation">Passwort wiederholen</label>
|
|
<input id="confirmation" name="confirmation" type="password" autocomplete="new-password" required />
|
|
@if (Error is not null)
|
|
{
|
|
<p class="error">@Error</p>
|
|
}
|
|
<button type="submit">Passwort festlegen</button>
|
|
</form>
|
|
|
|
@code {
|
|
[SupplyParameterFromQuery(Name = "error")] private string? Error { get; set; }
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
if (await Admin.IsConfiguredAsync())
|
|
{
|
|
Navigation.NavigateTo("/login");
|
|
}
|
|
}
|
|
}
|