🐛 Avoid unexpected error when a cookie is expired.

This commit is contained in:
Andrey Antukh 2020-12-10 14:48:54 +01:00 committed by Alonso Torres
parent 7e020f967b
commit 8f37f74d29
2 changed files with 20 additions and 29 deletions

View file

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