diff --git a/app/dashboard/layout.tsx b/app/dashboard/layout.tsx index fba9a3a..9707b2c 100644 --- a/app/dashboard/layout.tsx +++ b/app/dashboard/layout.tsx @@ -79,12 +79,13 @@ function DashboardLayoutContent({ children }: { children: React.ReactNode }) { const userStore = UserStore.getInstance() const accessToken = userStore.getAccessToken() - if (accessToken) { + if (accessToken && userName !== null) { setIsAuthenticated(true) const pairingId = userStore.getUserPairingId() + setUserInfo({ id: pairingId?.slice(0, 8) + "...", - name: "Utilisateur 4NK", + name: userName, email: "user@4nk.io", role: "Utilisateur", company: "Organisation 4NK", @@ -98,7 +99,7 @@ function DashboardLayoutContent({ children }: { children: React.ReactNode }) { } } checkAuthentication() - }, [iframeUrl]) + }, [iframeUrl, userName]) const handle4nkConnect = useCallback(() => { setIsConnected(true);