From 643ea8048678d9ca849a0175dfe90c9c2afc9f80 Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Tue, 25 Nov 2025 12:43:49 +0100 Subject: [PATCH] :bug: Fix nitrate get-teams returns deleted teams --- backend/src/app/rpc/management/nitrate.clj | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/src/app/rpc/management/nitrate.clj b/backend/src/app/rpc/management/nitrate.clj index 77aac81d92..8898b27429 100644 --- a/backend/src/app/rpc/management/nitrate.clj +++ b/backend/src/app/rpc/management/nitrate.clj @@ -42,8 +42,9 @@ {::doc/added "2.12" ::sm/params schema:authenticate-params ::sm/result schema:profile} - [cfg {:keys [token]}] - (let [token (str/replace-first token #"^auth-token=" "") + [cfg {:keys [token] :as params}] + (let [_ (prn params) + token (str/replace-first token #"^auth-token=" "") claims (tokens/verify cfg {:token token :iss "authentication"}) profile-id (:uid claims) profile (profile/get-profile cfg profile-id)] @@ -60,7 +61,8 @@ JOIN team_profile_rel AS tpr ON t.id = tpr.team_id WHERE tpr.profile_id = ? AND tpr.is_owner = 't' - AND t.is_default = 'f';") + AND t.is_default = 'f' + AND t.deleted_at is null;") (def ^:private schema:team [:map