diff --git a/src/nextapp/shared/services/auth/auth-context.tsx b/src/nextapp/shared/services/auth/auth-context.tsx index fd0ada14c..75d695495 100644 --- a/src/nextapp/shared/services/auth/auth-context.tsx +++ b/src/nextapp/shared/services/auth/auth-context.tsx @@ -19,7 +19,8 @@ export const AuthProvider: React.FC = ({ children }) => { const route = links.find( (d) => d.url === router?.pathname || d.altUrls?.includes(router?.pathname) ); - const isUnauthorized = session.error && route?.access.length > 0; + const isUnauthorized = + (session.error || !session.user) && route?.access.length > 0; if (session.status == 'loading') { return <>;