mirror of
https://github.com/penpot/penpot.git
synced 2025-06-04 14:41:38 +02:00
🐛 Avoid unexpected error when a cookie is expired.
This commit is contained in:
parent
7e020f967b
commit
8f37f74d29
2 changed files with 20 additions and 29 deletions
|
@ -51,20 +51,12 @@
|
|||
|
||||
(defn on-navigate
|
||||
[router path]
|
||||
(let [match (match-path router path)
|
||||
profile (:profile storage)
|
||||
authed? (and (not (nil? profile))
|
||||
(not= (:id profile) uuid/zero))]
|
||||
|
||||
(let [match (match-path router path)]
|
||||
(cond
|
||||
(and (or (= path "")
|
||||
(nil? match))
|
||||
(not authed?))
|
||||
(or (= path "")
|
||||
(nil? match))
|
||||
(st/emit! (rt/nav :auth-login))
|
||||
|
||||
(and (nil? match) authed?)
|
||||
(st/emit! (rt/nav :dashboard-projects {:team-id (:default-team-id profile)}))
|
||||
|
||||
(nil? match)
|
||||
(st/emit! (rt/nav :not-found))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue