From cc454de9ce48b949dbda26104540fb6c9d397c47 Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Wed, 8 Jul 2026 14:21:34 +0200 Subject: [PATCH] :bug: Fix wrap nitrate sso when there is no profile (#10592) --- backend/src/app/rpc.clj | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/src/app/rpc.clj b/backend/src/app/rpc.clj index c99a9210a1..98126e574d 100644 --- a/backend/src/app/rpc.clj +++ b/backend/src/app/rpc.clj @@ -246,7 +246,8 @@ (::nitrate/sso mdata true)) (fn [cfg params] ;; Resolve team/project/file from explicit keys or from :id via metadata - (let [organization-id (uuid/coerce (:organization-id params)) + (let [profile-id (::profile-id params) + organization-id (uuid/coerce (:organization-id params)) id-type (::id-type mdata) id (uuid/coerce (:id params)) team-id (or (uuid/coerce (:team-id params)) @@ -255,9 +256,10 @@ (when (= id-type :project) id)) file-id (or (uuid/coerce (:file-id params)) (when (= id-type :file) id))] - (if (or organization-id team-id project-id file-id) + (if (and profile-id + (or organization-id team-id project-id file-id)) (let [cache-ref (or organization-id team-id project-id file-id) - profile-id (::profile-id params) + cache-key [profile-id cache-ref] cached (cache/get org-sso-auth-cache cache-key) result (if (some? cached)