mirror of
https://github.com/penpot/penpot.git
synced 2026-09-10 05:58:47 +00:00
🐛 Fix problem with login shoing wrong credentials
This commit is contained in:
parent
aa1fb718e0
commit
ee6489b202
@ -27,6 +27,7 @@
|
|||||||
[app.main.ui.ds.buttons.button :refer [button*]]
|
[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.icon :refer [icon*] :as i]
|
||||||
[app.main.ui.ds.foundations.assets.raw-svg :refer [raw-svg*]]
|
[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.icons :as deprecated-icon]
|
||||||
[app.main.ui.viewer.header :as viewer.header]
|
[app.main.ui.viewer.header :as viewer.header]
|
||||||
[app.util.dom :as dom]
|
[app.util.dom :as dom]
|
||||||
@ -558,8 +559,10 @@
|
|||||||
auth-error? (= type :authentication)
|
auth-error? (= type :authentication)
|
||||||
not-found? (= type :not-found)
|
not-found? (= type :not-found)
|
||||||
|
|
||||||
authenticated?
|
authenticated? (is-authenticated? profile)
|
||||||
(is-authenticated? profile)
|
|
||||||
|
;; Keeps whether the user was authenticated when this component first mounted.
|
||||||
|
initial-authenticated? (mf/with-memo [] authenticated?)
|
||||||
|
|
||||||
request-access?
|
request-access?
|
||||||
(and
|
(and
|
||||||
@ -575,13 +578,23 @@
|
|||||||
|
|
||||||
|
|
||||||
(if (or auth-error? not-found?)
|
(if (or auth-error? not-found?)
|
||||||
(if (not authenticated?)
|
(cond
|
||||||
|
(not authenticated?)
|
||||||
[:> context-wrapper*
|
[:> context-wrapper*
|
||||||
{:is-workspace workspace?
|
{:is-workspace workspace?
|
||||||
:is-dashboard dashboard?
|
:is-dashboard dashboard?
|
||||||
:is-viewer view?
|
:is-viewer view?
|
||||||
:profile profile}
|
:profile profile}
|
||||||
[:> login-modal* {}]]
|
[:> 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)
|
(when (get info :loaded false)
|
||||||
(if request-access?
|
(if request-access?
|
||||||
[:> context-wrapper* {:is-workspace workspace?
|
[:> context-wrapper* {:is-workspace workspace?
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user