mirror of
https://github.com/penpot/penpot.git
synced 2026-05-19 14:14:05 -04:00
🐛 Fix problem with login shoing wrong credentials
This commit is contained in:
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user