From bd46d1ff8f2bbe43a92e935aafadc1a63b3a1a5b Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Tue, 12 Sep 2023 15:56:22 +1000 Subject: Initial commit --- App.razor | 30 +++++++++++++++++++----------- Pages/Component/RedirectLogin.razor | 6 ++++++ Pages/ViewMedia.razor | 1 + _Imports.razor | 2 ++ 4 files changed, 28 insertions(+), 11 deletions(-) create mode 100644 Pages/Component/RedirectLogin.razor diff --git a/App.razor b/App.razor index d414dad..b4e47c9 100644 --- a/App.razor +++ b/App.razor @@ -1,11 +1,19 @@ - - - - - - Not found - -

Sorry, there's nothing at this address.

-
-
-
+ + + + + + + + + + + Not found + +

Sorry, there's nothing at this address.

+
+
+
+
diff --git a/Pages/Component/RedirectLogin.razor b/Pages/Component/RedirectLogin.razor new file mode 100644 index 0000000..290a7ac --- /dev/null +++ b/Pages/Component/RedirectLogin.razor @@ -0,0 +1,6 @@ +@inject NavigationManager navigationManager + +@code { + protected override void OnInitialized() => + navigationManager.NavigateTo("/Login", true); +} \ No newline at end of file diff --git a/Pages/ViewMedia.razor b/Pages/ViewMedia.razor index 7823c75..444fbc5 100644 --- a/Pages/ViewMedia.razor +++ b/Pages/ViewMedia.razor @@ -4,6 +4,7 @@ @inject IDbContextFactory dbFactory @inject ITagService tagService @inject IMediaService mediaService +@attribute [Authorize] @title diff --git a/_Imports.razor b/_Imports.razor index d20a491..4c5566b 100644 --- a/_Imports.razor +++ b/_Imports.razor @@ -1,6 +1,8 @@ @using HyperBooru @using HyperBooru.Pages.Component @using HyperBooru.Services +@using Microsoft.AspNetCore.Authorization +@using Microsoft.AspNetCore.Components.Authorization @using Microsoft.AspNetCore.Components.Routing @using Microsoft.AspNetCore.Components.Web @using Microsoft.EntityFrameworkCore -- cgit v1.3