theme draft 2 (done?)
This commit is contained in:
@@ -9,13 +9,11 @@ export function ProtectedRoute({ children }: ProtectedRouteProps) {
|
||||
const { isAuthenticated, isCheckingAuth } = useAuth();
|
||||
const location = useLocation();
|
||||
|
||||
// Show loading while checking authentication status
|
||||
if (isCheckingAuth) {
|
||||
return <div className="text-gray-500 dark:text-white">Loading...</div>;
|
||||
return <div className="text-content-muted">Loading...</div>;
|
||||
}
|
||||
|
||||
if (!isAuthenticated) {
|
||||
// Redirect to login with the current location saved
|
||||
return <Navigate to="/login" state={{ from: location }} replace />;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user