From 974084a9ca863a963f58b39138f3b973ba4cab22 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 23 Feb 2022 09:11:38 +0100 Subject: [PATCH] :bug: Add missing executor dependency to auth handlers --- backend/src/app/http/oauth.clj | 10 ++++++---- backend/src/app/main.clj | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/backend/src/app/http/oauth.clj b/backend/src/app/http/oauth.clj index 21347f688..17b372068 100644 --- a/backend/src/app/http/oauth.clj +++ b/backend/src/app/http/oauth.clj @@ -24,6 +24,8 @@ [integrant.core :as ig] [promesa.exec :as px])) +;; TODO: make it fully async (?) + (defn- build-redirect-uri [{:keys [provider] :as cfg}] (let [public (u/uri (:public-uri cfg))] @@ -214,9 +216,9 @@ (redirect-response uri)))) (defn- auth-handler - [{:keys [tokens executors] :as cfg} {:keys [params] :as request} respond _] + [{:keys [tokens executor] :as cfg} {:keys [params] :as request} respond _] (px/run! - (:default executors) + executor (fn [] (let [invitation (:invitation-token params) props (extract-utm-props params) @@ -232,9 +234,9 @@ :body {:redirect-uri uri}}))))) (defn- callback-handler - [{:keys [executors] :as cfg} request respond _] + [{:keys [executor] :as cfg} request respond _] (px/run! - (:default executors) + executor (fn [] (try (let [info (retrieve-info cfg request) diff --git a/backend/src/app/main.clj b/backend/src/app/main.clj index 9eb424b6c..6430a8e4e 100644 --- a/backend/src/app/main.clj +++ b/backend/src/app/main.clj @@ -143,6 +143,7 @@ :pool (ig/ref :app.db/pool) :tokens (ig/ref :app.tokens/tokens) :audit (ig/ref :app.loggers.audit/collector) + :executor (ig/ref [::default :app.worker/executor]) :public-uri (cf/get :public-uri)} :app.rpc/rpc