0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-27 00:49:28 -05:00

🐛 Fix error handling on verify-token page

This commit is contained in:
Andrey Antukh 2024-06-27 16:10:26 +02:00
parent c45a105186
commit 56160cf64d

View file

@ -70,7 +70,8 @@
(rx/subs! (rx/subs!
(fn [tdata] (fn [tdata]
(handle-token tdata)) (handle-token tdata))
(fn [{:keys [type code] :as error}] (fn [cause]
(let [{:keys [type code] :as error} (ex-data cause)]
(cond (cond
(or (= :validation type) (or (= :validation type)
(= :invalid-token code) (= :invalid-token code)
@ -90,7 +91,7 @@
:else :else
(let [msg (tr "errors.generic")] (let [msg (tr "errors.generic")]
(ts/schedule 100 #(st/emit! (msg/error msg))) (ts/schedule 100 #(st/emit! (msg/error msg)))
(st/emit! (rt/nav :auth-login)))))))) (st/emit! (rt/nav :auth-login)))))))))
(if @bad-token (if @bad-token
[:> static/invalid-token {}] [:> static/invalid-token {}]