mirror of
https://github.com/penpot/penpot.git
synced 2025-01-23 23:18:48 -05:00
🔥 Replace clojure.spec with simple assert on tokens ns
This commit is contained in:
parent
25265cec70
commit
046ef7eb6e
1 changed files with 7 additions and 6 deletions
|
@ -8,18 +8,19 @@
|
|||
"Tokens generation API."
|
||||
(:require
|
||||
[app.common.data :as d]
|
||||
[app.common.data.macros :as dm]
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.spec :as us]
|
||||
[app.common.transit :as t]
|
||||
[app.util.time :as dt]
|
||||
[buddy.sign.jwe :as jwe]
|
||||
[clojure.spec.alpha :as s]))
|
||||
|
||||
(s/def ::tokens-key bytes?)
|
||||
[buddy.sign.jwe :as jwe]))
|
||||
|
||||
(defn generate
|
||||
[{:keys [tokens-key]} claims]
|
||||
(us/assert! ::tokens-key tokens-key)
|
||||
|
||||
(dm/assert!
|
||||
"expexted token-key to be bytes instance"
|
||||
(bytes? tokens-key))
|
||||
|
||||
(let [payload (-> claims
|
||||
(assoc :iat (dt/now))
|
||||
(d/without-nils)
|
||||
|
|
Loading…
Add table
Reference in a new issue