mirror of
https://github.com/penpot/penpot.git
synced 2025-07-15 06:15:13 +02:00
✨ Allow overide the secret-key on setup module.
Usefull when using a pre-shared secret key.
This commit is contained in:
parent
af23d62568
commit
8ad8196d70
4 changed files with 29 additions and 16 deletions
|
@ -51,11 +51,11 @@
|
|||
claims))
|
||||
|
||||
(s/def ::secret-key ::us/string)
|
||||
(s/def ::sprops
|
||||
(s/def ::props
|
||||
(s/keys :req-un [::secret-key]))
|
||||
|
||||
(defmethod ig/pre-init-spec ::tokens [_]
|
||||
(s/keys :req-un [::sprops]))
|
||||
(s/keys :req-un [::props]))
|
||||
|
||||
(defn- generate-predefined
|
||||
[cfg {:keys [iss profile-id] :as params}]
|
||||
|
@ -71,8 +71,8 @@
|
|||
:hint "no predefined token")))
|
||||
|
||||
(defmethod ig/init-key ::tokens
|
||||
[_ {:keys [sprops] :as cfg}]
|
||||
(let [secret (derive-tokens-secret (:secret-key sprops))
|
||||
[_ {:keys [props] :as cfg}]
|
||||
(let [secret (derive-tokens-secret (:secret-key props))
|
||||
cfg (assoc cfg ::secret secret)]
|
||||
(fn [action params]
|
||||
(case action
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue