From 6b127c0c6ec81919ee8136edee88e49afb931fa8 Mon Sep 17 00:00:00 2001 From: Foxocube Date: Wed, 1 Jan 2025 00:37:14 +0000 Subject: [PATCH] Fix accessing login page while not logged in --- .../MediaFeeder/Components/Account/Pages/AccessDenied.razor | 2 ++ .../MediaFeeder/Components/Account/Pages/ConfirmEmail.razor | 3 +++ .../Components/Account/Pages/ConfirmEmailChange.razor | 3 +++ .../MediaFeeder/Components/Account/Pages/ExternalLogin.razor | 2 ++ .../MediaFeeder/Components/Account/Pages/InvalidUser.razor | 2 ++ MediaFeeder/MediaFeeder/Components/Account/Pages/Login.razor | 2 ++ 6 files changed, 14 insertions(+) diff --git a/MediaFeeder/MediaFeeder/Components/Account/Pages/AccessDenied.razor b/MediaFeeder/MediaFeeder/Components/Account/Pages/AccessDenied.razor index 8600a2d..618ec09 100644 --- a/MediaFeeder/MediaFeeder/Components/Account/Pages/AccessDenied.razor +++ b/MediaFeeder/MediaFeeder/Components/Account/Pages/AccessDenied.razor @@ -1,4 +1,6 @@ @page "/Account/AccessDenied" +@using Microsoft.AspNetCore.Authorization +@attribute [AllowAnonymous] Access denied diff --git a/MediaFeeder/MediaFeeder/Components/Account/Pages/ConfirmEmail.razor b/MediaFeeder/MediaFeeder/Components/Account/Pages/ConfirmEmail.razor index 7b481ff..b7c4c49 100644 --- a/MediaFeeder/MediaFeeder/Components/Account/Pages/ConfirmEmail.razor +++ b/MediaFeeder/MediaFeeder/Components/Account/Pages/ConfirmEmail.razor @@ -1,12 +1,15 @@ @page "/Account/ConfirmEmail" @using System.Text @using MediaFeeder.Data.db +@using Microsoft.AspNetCore.Authorization @using Microsoft.AspNetCore.Identity @using Microsoft.AspNetCore.WebUtilities @inject UserManager UserManager @inject IdentityRedirectManager RedirectManager +@attribute [AllowAnonymous] + Confirm email

Confirm email

diff --git a/MediaFeeder/MediaFeeder/Components/Account/Pages/ConfirmEmailChange.razor b/MediaFeeder/MediaFeeder/Components/Account/Pages/ConfirmEmailChange.razor index a20ebb2..3facf37 100644 --- a/MediaFeeder/MediaFeeder/Components/Account/Pages/ConfirmEmailChange.razor +++ b/MediaFeeder/MediaFeeder/Components/Account/Pages/ConfirmEmailChange.razor @@ -1,6 +1,7 @@ @page "/Account/ConfirmEmailChange" @using System.Text @using MediaFeeder.Data.db +@using Microsoft.AspNetCore.Authorization @using Microsoft.AspNetCore.Identity @using Microsoft.AspNetCore.WebUtilities @@ -8,6 +9,8 @@ @inject SignInManager SignInManager @inject IdentityRedirectManager RedirectManager +@attribute [AllowAnonymous] + Confirm email change

Confirm email change

diff --git a/MediaFeeder/MediaFeeder/Components/Account/Pages/ExternalLogin.razor b/MediaFeeder/MediaFeeder/Components/Account/Pages/ExternalLogin.razor index 4e14e61..186a0d2 100644 --- a/MediaFeeder/MediaFeeder/Components/Account/Pages/ExternalLogin.razor +++ b/MediaFeeder/MediaFeeder/Components/Account/Pages/ExternalLogin.razor @@ -4,10 +4,12 @@ @using System.Text @using System.Text.Encodings.Web @using MediaFeeder.Data.db +@using Microsoft.AspNetCore.Authorization @using Microsoft.AspNetCore.Identity @using Microsoft.AspNetCore.Mvc @using Microsoft.AspNetCore.WebUtilities @attribute [IgnoreAntiforgeryToken] +@attribute [AllowAnonymous] @inject SignInManager SignInManager @inject UserManager UserManager diff --git a/MediaFeeder/MediaFeeder/Components/Account/Pages/InvalidUser.razor b/MediaFeeder/MediaFeeder/Components/Account/Pages/InvalidUser.razor index 1a5391c..f34f5cc 100644 --- a/MediaFeeder/MediaFeeder/Components/Account/Pages/InvalidUser.razor +++ b/MediaFeeder/MediaFeeder/Components/Account/Pages/InvalidUser.razor @@ -1,4 +1,6 @@ @page "/Account/InvalidUser" +@using Microsoft.AspNetCore.Authorization +@attribute [AllowAnonymous] Invalid user diff --git a/MediaFeeder/MediaFeeder/Components/Account/Pages/Login.razor b/MediaFeeder/MediaFeeder/Components/Account/Pages/Login.razor index 17e7d46..8883200 100644 --- a/MediaFeeder/MediaFeeder/Components/Account/Pages/Login.razor +++ b/MediaFeeder/MediaFeeder/Components/Account/Pages/Login.razor @@ -1,4 +1,6 @@ @page "/Account/Login" +@using Microsoft.AspNetCore.Authorization +@attribute [AllowAnonymous] Log in