@page "/login"
@attribute [AllowAnonymous]
@inject NavigationManager Nav
Anmelden – Timetracker
@* ── Logo / Header ── *@
Timetracker
@* ── Static Tab Navigation ── *@
Anmelden
Registrieren
@if (_activeTab == 0)
{
@* ── Login Form ── *@
@if (_error != null)
{
@_error
}
}
else
{
@* ── Register Form ── *@
@if (_error != null)
{
@_error
}
}
@code {
private int _activeTab = 0;
private string? _error;
[SupplyParameterFromQuery(Name = "error")]
public string? ErrorParam { get; set; }
[SupplyParameterFromQuery(Name = "tab")]
public string? TabParam { get; set; }
protected override void OnParametersSet()
{
_error = ErrorParam switch
{
"invalid" => "Benutzername oder Passwort falsch.",
not null => Uri.UnescapeDataString(ErrorParam),
_ => null
};
_activeTab = TabParam == "register" ? 1 : 0;
}
}