mirror of
https://github.com/penpot/penpot.git
synced 2025-05-19 14:46:12 +02:00
🐛 Fix incorrect redirect on login with different user after logout
This commit is contained in:
parent
41794c5f5e
commit
90cb2c4518
2 changed files with 10 additions and 4 deletions
|
@ -227,9 +227,14 @@
|
||||||
(ptk/reify ::login-from-token
|
(ptk/reify ::login-from-token
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ _ _]
|
(watch [_ _ _]
|
||||||
(rx/of (logged-in
|
(->> (rx/of (logged-in (with-meta profile {::ev/source "login-with-token"})))
|
||||||
(with-meta profile
|
;; NOTE: we need this to be asynchronous because the effect
|
||||||
{::ev/source "login-with-token"}))))))
|
;; should be called before proceed with the login process
|
||||||
|
(rx/observe-on :async)))
|
||||||
|
|
||||||
|
ptk/EffectEvent
|
||||||
|
(effect [_ _ _]
|
||||||
|
(set-current-team! nil))))
|
||||||
|
|
||||||
(defn login-from-register
|
(defn login-from-register
|
||||||
"Event used mainly for mark current session as logged-in in after the
|
"Event used mainly for mark current session as logged-in in after the
|
||||||
|
@ -274,6 +279,7 @@
|
||||||
(effect [_ _ _]
|
(effect [_ _ _]
|
||||||
;; We prefer to keek some stuff in the storage like the current-team-id and the profile
|
;; We prefer to keek some stuff in the storage like the current-team-id and the profile
|
||||||
(swap! storage dissoc :redirect-url)
|
(swap! storage dissoc :redirect-url)
|
||||||
|
(set-current-team! nil)
|
||||||
(i18n/reset-locale)))))
|
(i18n/reset-locale)))))
|
||||||
|
|
||||||
(defn logout
|
(defn logout
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
(defmethod handle-token :verify-email
|
(defmethod handle-token :verify-email
|
||||||
[data]
|
[data]
|
||||||
(let [msg (tr "dashboard.notifications.email-verified-successfully")]
|
(let [msg (tr "dashboard.notifications.email-verified-successfully")]
|
||||||
(ts/schedule 100 #(st/emit! (dm/success msg)))
|
(ts/schedule 1000 #(st/emit! (dm/success msg)))
|
||||||
(st/emit! (du/login-from-token data))))
|
(st/emit! (du/login-from-token data))))
|
||||||
|
|
||||||
(defmethod handle-token :change-email
|
(defmethod handle-token :change-email
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue