From 952ab032f97bbdb574663bdbe0ae76782399e2b1 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 15 Apr 2025 15:31:20 +0200 Subject: [PATCH] :tada: Add authenticate prepl rpc method --- backend/src/app/srepl/cli.clj | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/src/app/srepl/cli.clj b/backend/src/app/srepl/cli.clj index 5dfb786ec2..188830b052 100644 --- a/backend/src/app/srepl/cli.clj +++ b/backend/src/app/srepl/cli.clj @@ -13,6 +13,8 @@ [app.db :as db] [app.rpc.commands.auth :as cmd.auth] [app.rpc.commands.profile :as cmd.profile] + [app.setup :as-alias setup] + [app.tokens :as tokens] [app.util.time :as dt] [cuerdas.core :as str])) @@ -109,6 +111,12 @@ [{:keys [password]}] (auth/derive-password password)) +(defmethod exec-command "authenticate" + [{:keys [token]}] + (when-let [system (get-current-system)] + (let [props (get system ::setup/props)] + (tokens/verify props {:token token :iss "authentication"})))) + (defmethod exec-command :default [{:keys [::cmd]}] (ex/raise :type :internal