mirror of
https://github.com/penpot/penpot.git
synced 2025-01-27 00:49:28 -05:00
Merge pull request #3604 from penpot/superalex-fix-log-out-log-in-with-different-acounts-page-not-exist
🐛 Fix logout and login with different accounts show 404 error page
This commit is contained in:
commit
3fea366a04
1 changed files with 10 additions and 5 deletions
|
@ -105,9 +105,15 @@
|
||||||
|
|
||||||
ptk/EffectEvent
|
ptk/EffectEvent
|
||||||
(effect [_ state _]
|
(effect [_ state _]
|
||||||
(when-let [profile (:profile state)]
|
(let [profile (:profile state)
|
||||||
|
email (:email profile)
|
||||||
|
previous-profile (:profile @storage)
|
||||||
|
previous-email (:email previous-profile)]
|
||||||
|
(when profile
|
||||||
(swap! storage assoc :profile profile)
|
(swap! storage assoc :profile profile)
|
||||||
(i18n/set-locale! (:lang profile))))))
|
(i18n/set-locale! (:lang profile))
|
||||||
|
(when (not= previous-email email)
|
||||||
|
(swap! storage dissoc ::current-team-id)))))))
|
||||||
|
|
||||||
(defn fetch-profile
|
(defn fetch-profile
|
||||||
[]
|
[]
|
||||||
|
@ -247,9 +253,8 @@
|
||||||
|
|
||||||
ptk/EffectEvent
|
ptk/EffectEvent
|
||||||
(effect [_ _ _]
|
(effect [_ _ _]
|
||||||
;; We prefer to keek some stuff in the storage like the current-team-id
|
;; 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)
|
||||||
(swap! storage dissoc :profile)
|
|
||||||
(i18n/reset-locale)))))
|
(i18n/reset-locale)))))
|
||||||
|
|
||||||
(defn logout
|
(defn logout
|
||||||
|
|
Loading…
Add table
Reference in a new issue