Add onboarding pages

This commit is contained in:
Urtzi Alfaro
2025-09-01 08:13:01 +02:00
parent bde52d8ca2
commit 330e4a06b1
8 changed files with 518 additions and 113 deletions

View File

@@ -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..." />;