From bcaa48e5de0a82057a2339f24fe0413826ab1b83 Mon Sep 17 00:00:00 2001 From: Alexander Borg Date: Sun, 14 Sep 2025 10:00:04 +0200 Subject: [PATCH] Fix jwt-token --- client/src/contexts/AuthContext.jsx | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/client/src/contexts/AuthContext.jsx b/client/src/contexts/AuthContext.jsx index d662636..6297c64 100644 --- a/client/src/contexts/AuthContext.jsx +++ b/client/src/contexts/AuthContext.jsx @@ -59,17 +59,8 @@ export const AuthProvider = ({ children }) => { // Check if user is logged in on app start const token = localStorage.getItem('token'); if (token) { - // Temporarily disable automatic profile validation to fix reload issue - // checkAuthStatus(); - - // Instead, just mark as authenticated if token exists - dispatch({ - type: 'LOGIN_SUCCESS', - payload: { - user: { username: 'admin' }, // Minimal user object - token: token - } - }); + // Check auth status to get full user profile including role + checkAuthStatus(); } else { dispatch({ type: 'SET_LOADING', payload: false }); }