logout issues # 2

This commit is contained in:
IGNY8 VPS (Salman)
2025-12-15 17:22:50 +00:00
parent 5366cc1805
commit 1887f2a665
6 changed files with 14 additions and 144 deletions

View File

@@ -48,18 +48,7 @@ export default function ProtectedRoute({ children }: ProtectedRouteProps) {
trackLoading('auth-loading', loading);
}, [loading]);
// Validate account + plan whenever auth/user changes
useEffect(() => {
if (!isAuthenticated) {
return;
}
if (!user?.account) {
setErrorMessage('This user is not linked to an account. Please contact support.');
logout();
return;
}
}, [isAuthenticated, user, logout]);
// Account/plan validation removed - backend middleware handles this on API calls
// Immediate check on mount: if loading is true, reset it immediately
useEffect(() => {