Use username in the dropdown menu

This commit is contained in:
omaroughriss 2025-11-13 16:51:24 +01:00
parent b9a996c11e
commit 726f34cd54

View File

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