From 6896a4e9f04993a01f8c2fedda3cdcdf5f732322 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 11 Jun 2024 10:51:38 +0200 Subject: [PATCH 1/3] :sparkles: Add minor improvements on how logout is handled The profile-id is now required on the body of logout request --- backend/src/app/rpc/commands/auth.clj | 15 ++++++++++++--- frontend/src/app/main/data/users.cljs | 14 +++++++++----- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/backend/src/app/rpc/commands/auth.clj b/backend/src/app/rpc/commands/auth.clj index 4073de2c3..b38fa83b5 100644 --- a/backend/src/app/rpc/commands/auth.clj +++ b/backend/src/app/rpc/commands/auth.clj @@ -130,12 +130,21 @@ ;; ---- COMMAND: Logout +(def ^:private schema:logout + [:map {:title "logoug"} + [:profile-id {:optional true} ::sm/uuid]]) + (sv/defmethod ::logout "Clears the authentication cookie and logout the current session." {::rpc/auth false - ::doc/added "1.15"} - [cfg _] - (rph/with-transform {} (session/delete-fn cfg))) + ::doc/changes [["2.1" "Now requires profile-id passed in the body"]] + ::doc/added "1.0" + ::sm/params schema:logout} + [cfg params] + (if (= (:profile-id params) + (::rpc/profile-id params)) + (rph/with-transform {} (session/delete-fn cfg)) + {})) ;; ---- COMMAND: Recover Profile diff --git a/frontend/src/app/main/data/users.cljs b/frontend/src/app/main/data/users.cljs index e49925038..e4f8c4d07 100644 --- a/frontend/src/app/main/data/users.cljs +++ b/frontend/src/app/main/data/users.cljs @@ -328,11 +328,15 @@ (-data [_] {}) ptk/WatchEvent - (watch [_ _ _] - (->> (rp/cmd! :logout) - (rx/delay-at-least 300) - (rx/catch (constantly (rx/of 1))) - (rx/map #(logged-out params))))))) + (watch [_ state _] + (let [profile-id (:profile-id state)] + (->> (rx/interval 500) + (rx/take 1) + (rx/mapcat (fn [_] + (->> (rp/cmd! :logout {:profile-id profile-id}) + (rx/delay-at-least 300) + (rx/catch (constantly (rx/of 1)))))) + (rx/map #(logged-out params)))))))) ;; --- Update Profile From c14f6aecf354fad02722796049b0d6dff35a90e3 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 11 Jun 2024 10:56:02 +0200 Subject: [PATCH 2/3] :paperclip: Update THANKYOU.md file --- THANKYOU.md | 1 + 1 file changed, 1 insertion(+) diff --git a/THANKYOU.md b/THANKYOU.md index 77a1483aa..17627df25 100644 --- a/THANKYOU.md +++ b/THANKYOU.md @@ -7,6 +7,7 @@ We want to thank to the amazing people that help us! Thank you! You're the best! * [Shiraz Ali Khan](https://www.linkedin.com/in/shiraz-ali-khan-1ba508180/) * Vaibhav Shukla * Hassan Ahmed (Alias Xen Lee) +* Michal Biesiada (@mbiesiad) ## Internationalization * [00ff88](https://hosted.weblate.org/user/00ff88) From eba6f519533257b46f7329e2be2fb17f6fa21599 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 11 Jun 2024 10:56:45 +0200 Subject: [PATCH 3/3] :paperclip: Update THANKYOU.md file --- THANKYOU.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/THANKYOU.md b/THANKYOU.md index 17627df25..8c075112b 100644 --- a/THANKYOU.md +++ b/THANKYOU.md @@ -2,7 +2,11 @@ We want to thank to the amazing people that help us! Thank you! You're the best! +Feel free you make a PR updating this file if you miss you in the +list. + ## Security + * Husnain Iqbal (CEO OF ALPHA INFERNO PVT LTD) * [Shiraz Ali Khan](https://www.linkedin.com/in/shiraz-ali-khan-1ba508180/) * Vaibhav Shukla @@ -10,6 +14,7 @@ We want to thank to the amazing people that help us! Thank you! You're the best! * Michal Biesiada (@mbiesiad) ## Internationalization + * [00ff88](https://hosted.weblate.org/user/00ff88) * [AhmadHB](https://hosted.weblate.org/user/AhmadHB) * [Aimee](https://hosted.weblate.org/user/Aimee) @@ -91,6 +96,7 @@ We want to thank to the amazing people that help us! Thank you! You're the best! * [zcraber](https://hosted.weblate.org/user/zcraber) ## Libraries & templates + * systxema * plumilla * victor crespo