0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-25 07:58:49 -05:00

🐛 Properly redirect to login on unauthorized request.

This commit is contained in:
Andrey Antukh 2020-11-23 09:48:09 +01:00 committed by Alonso Torres
parent fa0e0af5b9
commit 420294aef4

View file

@ -33,6 +33,7 @@
[app.main.ui.workspace :as workspace]
[app.util.i18n :as i18n :refer [tr t]]
[app.util.timers :as ts]
[app.util.router :as rt]
[cuerdas.core :as str]
[cljs.spec.alpha :as s]
[expound.alpha :as expound]
@ -222,8 +223,10 @@
(defmethod ptk/handle-error :authorization
[error]
(st/emit! (rt/nav :login))
(ts/schedule
(st/emitf (dm/show {:content "Not authorized to see this content."
:timeout 5000
:type :error}))))
(defmethod ptk/handle-error :assertion