Fix jwt-token
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user