From ee51e8c719cc557ae9ec99216f2598d06d98e6ab Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 13 Jul 2022 12:55:56 +0200 Subject: [PATCH] :sparkles: Always assoc :iat claim to tokens for better traceability --- backend/src/app/tokens.clj | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/src/app/tokens.clj b/backend/src/app/tokens.clj index 532055c90..dc68c6897 100644 --- a/backend/src/app/tokens.clj +++ b/backend/src/app/tokens.clj @@ -18,7 +18,10 @@ (defn- generate [cfg claims] - (let [payload (-> claims d/without-nils t/encode)] + (let [payload (-> claims + (assoc :iat (dt/now)) + (d/without-nils) + (t/encode))] (jwe/encrypt payload (::secret cfg) {:alg :a256kw :enc :a256gcm}))) (defn- verify