From fd69037e5be95f571a816ec79a9952a79e7c1d6e Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 18 May 2026 18:05:35 +0200 Subject: [PATCH] :bug: Fix problem with login shoing wrong credentials --- frontend/src/app/main/ui/static.cljs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/main/ui/static.cljs b/frontend/src/app/main/ui/static.cljs index 07fb10ea17..1b4b0e16b0 100644 --- a/frontend/src/app/main/ui/static.cljs +++ b/frontend/src/app/main/ui/static.cljs @@ -27,6 +27,7 @@ [app.main.ui.ds.buttons.button :refer [button*]] [app.main.ui.ds.foundations.assets.icon :refer [icon*] :as i] [app.main.ui.ds.foundations.assets.raw-svg :refer [raw-svg*]] + [app.main.ui.ds.product.loader :refer [loader*]] [app.main.ui.icons :as deprecated-icon] [app.main.ui.viewer.header :as viewer.header] [app.util.dom :as dom] @@ -558,8 +559,10 @@ auth-error? (= type :authentication) not-found? (= type :not-found) - authenticated? - (is-authenticated? profile) + authenticated? (is-authenticated? profile) + + ;; Keeps whether the user was authenticated when this component first mounted. + initial-authenticated? (mf/with-memo [] authenticated?) request-access? (and @@ -575,13 +578,23 @@ (if (or auth-error? not-found?) - (if (not authenticated?) + (cond + (not authenticated?) [:> context-wrapper* {:is-workspace workspace? :is-dashboard dashboard? :is-viewer view? :profile profile} [:> login-modal* {}]] + + ;; The user was not authenticated when exception-page first + ;; mounted, but they have just logged in via the login modal. + ;; Show a loading indicator to prevent briefly flashing the + ;; "no permission" dialog. + (not initial-authenticated?) + [:> loader* {:title (tr "labels.loading") :overlay true}] + + :else (when (get info :loaded false) (if request-access? [:> context-wrapper* {:is-workspace workspace?