31 lines
No EOL
1 KiB
Text
31 lines
No EOL
1 KiB
Text
@using Microsoft.AspNetCore.Components.Authorization
|
|
@inject NavigationManager navigationManager
|
|
<Router AppAssembly="@typeof(MauiProgram).Assembly">
|
|
<Found Context="routeData">
|
|
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)">
|
|
<Authorizing>Logging in...</Authorizing>
|
|
<NotAuthorized><RedirectToLogin /></NotAuthorized>
|
|
</AuthorizeRouteView>
|
|
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
|
|
</Found>
|
|
<NotFound>
|
|
<CascadingAuthenticationState>
|
|
<LayoutView Layout="@typeof(Layout.MainLayout)">
|
|
<img data-emoji="🦒" />
|
|
<p>Sorry, there's nothing here.</p>
|
|
</LayoutView>
|
|
</CascadingAuthenticationState>
|
|
</NotFound>
|
|
</Router>
|
|
|
|
|
|
@code
|
|
{
|
|
protected override void OnAfterRender(bool firstRender) {
|
|
string? shareString = Preferences.Get("shareString", null);
|
|
if (!string.IsNullOrWhiteSpace(shareString)) {
|
|
Preferences.Remove("shareString");
|
|
navigationManager.NavigateTo($"/sharetext/{shareString}");
|
|
}
|
|
}
|
|
} |