0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-26 00:19:07 -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 7facd69039
commit f364666d48

View file

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