diff --git a/.env.example b/.env.example index db47b9df..f572885e 100644 --- a/.env.example +++ b/.env.example @@ -46,7 +46,7 @@ NEXT_PUBLIC_HOTJAR_VERSION= # RELAY_URLS=wss://demo.4nkweb.com/ws RELAY_URLS=wss://dev4.4nkweb.com/ws # SIGNER_WS_URL=https://dev4.4nkweb.com/signer/ -SIGNER_WS_URL=https://dev4.4nkweb.com/signer/ +SIGNER_WS_URL=https://dev3.4nkweb.com/signer/ # IHM URLS # VITE_BOOTSTRAPURL=http://sdk_relay:8090/ diff --git a/src/front/Components/Layouts/LoginCallback/index.tsx b/src/front/Components/Layouts/LoginCallback/index.tsx index 397e7adb..f8433c30 100644 --- a/src/front/Components/Layouts/LoginCallback/index.tsx +++ b/src/front/Components/Layouts/LoginCallback/index.tsx @@ -75,12 +75,6 @@ export default function LoginCallBack() { const code = router.query["code"]; if (code) { try { - // Nettoyer l'URL pour ne garder que la racine - const rootUrl = window.location.origin; - if (window.location.href !== rootUrl) { - window.history.replaceState({}, document.title, rootUrl); - } - const user: any = await Auth.getInstance().idNotAuth(code as string); // Extract both user data and auth token from the response @@ -109,6 +103,12 @@ export default function LoginCallBack() { setIsAuthModalOpen(true); console.log('[LoginCallback] authToken stored successfully'); + // Nettoyer l'URL pour ne garder que la racine (après succès) + const rootUrl = window.location.origin; + if (window.location.href !== rootUrl) { + window.history.replaceState({}, document.title, rootUrl); + } + return; } catch (e: any) { if (e.http_status === 401 && e.message === "Email not found") { @@ -122,8 +122,11 @@ export default function LoginCallBack() { } return router.push(Module.getInstance().get().modules.pages.Login.props.path + "?error=2"); } + if (!router.isReady) { + return; + } getUser(); - }, [router]); + }, [router, router.isReady]); return (