diff --git a/app/dashboard/layout.tsx b/app/dashboard/layout.tsx
index 395e943..7e30a5b 100644
--- a/app/dashboard/layout.tsx
+++ b/app/dashboard/layout.tsx
@@ -29,7 +29,7 @@ import MessageBus from "@/lib/4nk/MessageBus"
import UserStore from "@/lib/4nk/UserStore"
import Iframe from "@/components/4nk/Iframe"
import EventBus from "@/lib/4nk/EventBus"
-// DebugInfo supprimé
+import { iframeUrl } from "../page"
export default function DashboardLayout({ children }: { children: React.ReactNode }) {
const [isAuthenticated, setIsAuthenticated] = useState(false)
@@ -46,7 +46,6 @@ export default function DashboardLayout({ children }: { children: React.ReactNod
const router = useRouter()
const pathname = usePathname()
- const iframeUrl = process.env.NEXT_PUBLIC_4NK_IFRAME_URL || "https://dev3.4nkweb.com"
const navigation = [
{ name: "Tableau de bord", href: "/dashboard", icon: LayoutDashboard },
@@ -85,6 +84,7 @@ export default function DashboardLayout({ children }: { children: React.ReactNod
messageBus.isReady().then(() => {
messageBus.getMyProcesses().then((res: string[]) => {
setMyProcesses(res);
+ console.log("getMyProcesses", res);
})
});
}
@@ -168,8 +168,6 @@ export default function DashboardLayout({ children }: { children: React.ReactNod
Vérification de l'authentification...
- {}
-
)
}
@@ -351,7 +349,7 @@ export default function DashboardLayout({ children }: { children: React.ReactNod
)}
- {}
+ {isConnected && }
{/* Debug info retiré */}
diff --git a/app/dashboard/page.tsx b/app/dashboard/page.tsx
index 6ce6fd0..da9889b 100644
--- a/app/dashboard/page.tsx
+++ b/app/dashboard/page.tsx
@@ -26,7 +26,6 @@ import {
HardDrive,
X,
} from "lucide-react"
-import MessageBus from "@/lib/4nk/MessageBus"
import Link from "next/link"
export default function DashboardPage() {
@@ -54,11 +53,6 @@ export default function DashboardPage() {
const [notifications, setNotifications] = useState([])
useEffect(() => {
- const iframeUrl = process.env.NEXT_PUBLIC_4NK_IFRAME_URL || "https://dev3.4nkweb.com"
- const messageBus = MessageBus.getInstance(iframeUrl)
- // const mockMode = messageBus.isInMockMode()
- // setIsMockMode(mockMode)
-
// Simuler le chargement des données
if (true) {
setStats({
diff --git a/app/page.tsx b/app/page.tsx
index 0f925dc..240a677 100644
--- a/app/page.tsx
+++ b/app/page.tsx
@@ -1,6 +1,6 @@
"use client"
-import { useEffect, useState } from "react"
+import { useCallback, useEffect, useState } from "react"
import { useRouter } from "next/navigation"
import Link from "next/link"
import { Button } from "@/components/ui/button"
@@ -8,16 +8,25 @@ import { Badge } from "@/components/ui/badge"
import { Shield, ArrowRight, Key, Zap, Users, Globe, Database, Code, CheckCircle } from "lucide-react"
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
import AuthModal from "@/components/4nk/AuthModal"
-import Iframe from "@/components/4nk/Iframe"
-import UserStore from "@/lib/4nk/UserStore"
+
+export const iframeUrl = 'https://dev3.4nkweb.com'
export default function HomePage() {
- const [showLoginModal, setShowLoginModal] = useState(false)
+ const [showAuthModal, setShowAuthModal] = useState(false)
const [isConnected, setIsConnected] = useState(false)
- const [userPairingId, setUserPairingId] = useState(null)
+
+ const handleAuthConnect = useCallback(() => {
+ setIsConnected(true);
+ setShowAuthModal(false);
+ router.push("/dashboard")
+ console.log('Auth Connect - Connexion établie, le useEffect se chargera de récupérer le userPairingId');
+ }, []);
+
+ const handleAuthClose = useCallback(() => {
+ setShowAuthModal(false);
+ }, []);
const router = useRouter()
- const iframeUrl = process.env.NEXT_PUBLIC_4NK_IFRAME_URL || "https://dev3.4nkweb.com"
return (
@@ -44,7 +53,7 @@ export default function HomePage() {
-
+
@@ -76,20 +85,15 @@ export default function HomePage() {
{/* Modal d’authentification */}
- {showLoginModal && (
+ {showAuthModal && (
{
- setShowLoginModal(false)
- router.push("/dashboard") // ✅ redirection après login
- }}
- onClose={() => setShowLoginModal(false)}
+ isOpen={showAuthModal}
+ onConnect={handleAuthConnect}
+ onClose={handleAuthClose}
iframeUrl={iframeUrl}
/>
)}
- {}
-
{/* Product Features */}