fix: Session is now stored in protected local storage and not in session storage, making the login persistant between pages

This commit is contained in:
limited_dev 2023-02-12 14:55:37 +01:00
parent b1a6ab211e
commit 2d458fd2f2

View file

@ -7,10 +7,11 @@ namespace ImageBoardServerApp.Auth;
public class CustomAuthenticationStateProvider : AuthenticationStateProvider public class CustomAuthenticationStateProvider : AuthenticationStateProvider
{ {
private readonly ProtectedSessionStorage _sessionStorage; private readonly ProtectedLocalStorage _sessionStorage;
private ClaimsPrincipal _anonymous = new ClaimsPrincipal(new ClaimsIdentity()); private ClaimsPrincipal _anonymous = new ClaimsPrincipal(new ClaimsIdentity());
public CustomAuthenticationStateProvider(ProtectedSessionStorage sessionStorage) public CustomAuthenticationStateProvider(ProtectedLocalStorage sessionStorage)
{ {
_sessionStorage = sessionStorage; _sessionStorage = sessionStorage;
} }