mirror of
https://github.com/penpot/penpot.git
synced 2026-08-25 14:18:40 +00:00
✨ Update auth urls navigation
This commit is contained in:
parent
f2862b6c16
commit
5136eef4bc
@ -92,17 +92,23 @@
|
|||||||
|
|
||||||
(defn on-navigate
|
(defn on-navigate
|
||||||
[router path]
|
[router path]
|
||||||
(let [match (match-path router path)
|
(let [match (match-path router path)
|
||||||
profile (:profile @storage)
|
profile (:profile @storage)
|
||||||
nopath? (or (= path "") (= path "/"))
|
nopath? (or (= path "") (= path "/"))
|
||||||
authed? (and (not (nil? profile))
|
path-name (-> match :data :name)
|
||||||
(not= (:id profile) uuid/zero))]
|
authpath? (some #(= path-name %) '(:auth-login
|
||||||
|
:auth-register
|
||||||
|
:auth-register-validate
|
||||||
|
:auth-register-success
|
||||||
|
:auth-recovery-request
|
||||||
|
:auth-recovery))
|
||||||
|
authed? (and (not (nil? profile))
|
||||||
|
(not= (:id profile) uuid/zero))]
|
||||||
|
|
||||||
(cond
|
(cond
|
||||||
(and nopath? authed? (nil? match))
|
(or (and nopath? authed? (nil? match))
|
||||||
(if (not= uuid/zero profile)
|
(and authpath? authed?))
|
||||||
(st/emit! (rt/nav :dashboard-projects {:team-id (du/get-current-team-id profile)}))
|
(st/emit! (rt/nav :dashboard-projects {:team-id (du/get-current-team-id profile)}))
|
||||||
(st/emit! (rt/nav :auth-login)))
|
|
||||||
|
|
||||||
(and (not authed?) (nil? match))
|
(and (not authed?) (nil? match))
|
||||||
(st/emit! (rt/nav :auth-login))
|
(st/emit! (rt/nav :auth-login))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user