diff --git a/frontend/src/app/main/data/users.cljs b/frontend/src/app/main/data/users.cljs index 50cd0e584..08beb78f1 100644 --- a/frontend/src/app/main/data/users.cljs +++ b/frontend/src/app/main/data/users.cljs @@ -227,9 +227,14 @@ (ptk/reify ::login-from-token ptk/WatchEvent (watch [_ _ _] - (rx/of (logged-in - (with-meta profile - {::ev/source "login-with-token"})))))) + (->> (rx/of (logged-in (with-meta profile {::ev/source "login-with-token"}))) + ;; NOTE: we need this to be asynchronous because the effect + ;; should be called before proceed with the login process + (rx/observe-on :async))) + + ptk/EffectEvent + (effect [_ _ _] + (set-current-team! nil)))) (defn login-from-register "Event used mainly for mark current session as logged-in in after the @@ -274,6 +279,7 @@ (effect [_ _ _] ;; We prefer to keek some stuff in the storage like the current-team-id and the profile (swap! storage dissoc :redirect-url) + (set-current-team! nil) (i18n/reset-locale))))) (defn logout diff --git a/frontend/src/app/main/ui/auth/verify_token.cljs b/frontend/src/app/main/ui/auth/verify_token.cljs index e0dcd7cfe..827e37f0e 100644 --- a/frontend/src/app/main/ui/auth/verify_token.cljs +++ b/frontend/src/app/main/ui/auth/verify_token.cljs @@ -25,7 +25,7 @@ (defmethod handle-token :verify-email [data] (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)))) (defmethod handle-token :change-email