mirror of
https://github.com/penpot/penpot.git
synced 2025-08-04 00:28:28 +02:00
🎉 Add authenticate prepl rpc method
This commit is contained in:
parent
2df6f2b8b1
commit
952ab032f9
1 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue