mirror of
https://github.com/penpot/penpot.git
synced 2025-06-07 11:31:40 +02:00
🐛 Properly redirect to login on unauthorized request.
This commit is contained in:
parent
fa0e0af5b9
commit
420294aef4
1 changed files with 3 additions and 0 deletions
|
@ -33,6 +33,7 @@
|
||||||
[app.main.ui.workspace :as workspace]
|
[app.main.ui.workspace :as workspace]
|
||||||
[app.util.i18n :as i18n :refer [tr t]]
|
[app.util.i18n :as i18n :refer [tr t]]
|
||||||
[app.util.timers :as ts]
|
[app.util.timers :as ts]
|
||||||
|
[app.util.router :as rt]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[cljs.spec.alpha :as s]
|
[cljs.spec.alpha :as s]
|
||||||
[expound.alpha :as expound]
|
[expound.alpha :as expound]
|
||||||
|
@ -222,8 +223,10 @@
|
||||||
|
|
||||||
(defmethod ptk/handle-error :authorization
|
(defmethod ptk/handle-error :authorization
|
||||||
[error]
|
[error]
|
||||||
|
(st/emit! (rt/nav :login))
|
||||||
(ts/schedule
|
(ts/schedule
|
||||||
(st/emitf (dm/show {:content "Not authorized to see this content."
|
(st/emitf (dm/show {:content "Not authorized to see this content."
|
||||||
|
:timeout 5000
|
||||||
:type :error}))))
|
:type :error}))))
|
||||||
|
|
||||||
(defmethod ptk/handle-error :assertion
|
(defmethod ptk/handle-error :assertion
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue