From a13c7e9e2f171ae1dd71ff90cd3e5543b5611a08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?gr=C3=A9goire=20parant?= Date: Thu, 14 Apr 2022 10:17:59 +0200 Subject: [PATCH] Improve profile menu to implement user identity connected URL (#2055) # Improve profile menu to implement user identity connected URL - Create URL and get user identity - Check if user is connected or show connexion button - Improve profile to check before user data and don't display error webpage in menu --- front/src/Administration/AnalyticsClient.ts | 2 +- .../src/Components/Menu/ProfileSubMenu.svelte | 15 ++-- front/src/Connexion/ConnectionManager.ts | 4 +- front/src/Enum/EnvironmentVariable.ts | 1 + front/src/Stores/MenuStore.ts | 26 +++++- front/vite.config.ts | 1 + .../src/Controller/AuthenticateController.ts | 85 ++++++++++++++++++- 7 files changed, 116 insertions(+), 18 deletions(-) diff --git a/front/src/Administration/AnalyticsClient.ts b/front/src/Administration/AnalyticsClient.ts index 4c1ca93a..8c14eaed 100644 --- a/front/src/Administration/AnalyticsClient.ts +++ b/front/src/Administration/AnalyticsClient.ts @@ -9,7 +9,7 @@ class AnalyticsClient { constructor() { if (POSTHOG_API_KEY && POSTHOG_URL) { this.posthogPromise = import("posthog-js").then(({ default: posthog }) => { - posthog.init(POSTHOG_API_KEY, { api_host: POSTHOG_URL, disable_cookie: true }); + posthog.init(POSTHOG_API_KEY, { api_host: POSTHOG_URL }); //the posthog toolbar need a reference in window to be able to work window.posthog = posthog; return posthog; diff --git a/front/src/Components/Menu/ProfileSubMenu.svelte b/front/src/Components/Menu/ProfileSubMenu.svelte index 09237e36..1c6a744e 100644 --- a/front/src/Components/Menu/ProfileSubMenu.svelte +++ b/front/src/Components/Menu/ProfileSubMenu.svelte @@ -1,7 +1,13 @@