From 2d458fd2f232e5091b42b53c9cf5d85315b2fb7e Mon Sep 17 00:00:00 2001 From: limited_dev Date: Sun, 12 Feb 2023 14:55:37 +0100 Subject: [PATCH] fix: Session is now stored in protected local storage and not in session storage, making the login persistant between pages --- .../Auth/CustomAuthenticationStateProvider.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ImageBoardServerApp/Auth/CustomAuthenticationStateProvider.cs b/ImageBoardServerApp/Auth/CustomAuthenticationStateProvider.cs index 86c5e5d..3234b0a 100644 --- a/ImageBoardServerApp/Auth/CustomAuthenticationStateProvider.cs +++ b/ImageBoardServerApp/Auth/CustomAuthenticationStateProvider.cs @@ -7,10 +7,11 @@ namespace ImageBoardServerApp.Auth; public class CustomAuthenticationStateProvider : AuthenticationStateProvider { - private readonly ProtectedSessionStorage _sessionStorage; + private readonly ProtectedLocalStorage _sessionStorage; + private ClaimsPrincipal _anonymous = new ClaimsPrincipal(new ClaimsIdentity()); - public CustomAuthenticationStateProvider(ProtectedSessionStorage sessionStorage) + public CustomAuthenticationStateProvider(ProtectedLocalStorage sessionStorage) { _sessionStorage = sessionStorage; }