Add onboarding pages
This commit is contained in:
@@ -6,6 +6,7 @@ import React from 'react';
|
||||
import { Navigate, useLocation } from 'react-router-dom';
|
||||
import { useAuthUser, useIsAuthenticated, useAuthLoading } from '../stores';
|
||||
import { RouteConfig, canAccessRoute, ROUTES } from './routes.config';
|
||||
import { isMockAuthentication } from '../config/mock.config';
|
||||
|
||||
interface ProtectedRouteProps {
|
||||
children: React.ReactNode;
|
||||
@@ -128,6 +129,13 @@ export const ProtectedRoute: React.FC<ProtectedRouteProps> = ({
|
||||
const isLoading = useAuthLoading();
|
||||
const location = useLocation();
|
||||
|
||||
// MOCK MODE - Allow access to onboarding routes for testing
|
||||
const isOnboardingRoute = location.pathname.startsWith('/app/onboarding');
|
||||
|
||||
if (isMockAuthentication() && isOnboardingRoute) {
|
||||
return <>{children}</>;
|
||||
}
|
||||
|
||||
// Show loading spinner while checking authentication
|
||||
if (isLoading) {
|
||||
return fallback || <LoadingSpinner message="Verificando autenticación..." />;
|
||||
|
||||
Reference in New Issue
Block a user