🐛 Fix problem with login shoing wrong credentials

This commit is contained in:
alonso.torres
2026-05-18 18:05:35 +02:00
parent 1b6b367951
commit fd69037e5b

View File

@@ -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?