ecwt 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.cjs CHANGED
@@ -249,14 +249,7 @@ var EcwtFactory = class {
249
249
  if (ttl_initial === null) await this.#redisClient.HSET(this.#redis_key_revoked, token_id, "");
250
250
  else {
251
251
  const expires_in_ms = created_at_ms + ttl_initial * 1e3 - Date.now();
252
- if (expires_in_ms > 0) await this.#redisClient.sendCommand([
253
- "HSET",
254
- this.#redis_key_revoked,
255
- token_id,
256
- "",
257
- "PX",
258
- String(expires_in_ms)
259
- ]);
252
+ if (expires_in_ms > 0) await this.#redisClient.MULTI().HSET(this.#redis_key_revoked, token_id, "").HPEXPIRE(this.#redis_key_revoked, token_id, expires_in_ms).EXEC();
260
253
  }
261
254
  } else console.warn("[ecwt] Redis client is not provided. Tokens cannot be revoked.");
262
255
  }
package/dist/main.mjs CHANGED
@@ -225,14 +225,7 @@ var EcwtFactory = class {
225
225
  if (ttl_initial === null) await this.#redisClient.HSET(this.#redis_key_revoked, token_id, "");
226
226
  else {
227
227
  const expires_in_ms = created_at_ms + ttl_initial * 1e3 - Date.now();
228
- if (expires_in_ms > 0) await this.#redisClient.sendCommand([
229
- "HSET",
230
- this.#redis_key_revoked,
231
- token_id,
232
- "",
233
- "PX",
234
- String(expires_in_ms)
235
- ]);
228
+ if (expires_in_ms > 0) await this.#redisClient.MULTI().HSET(this.#redis_key_revoked, token_id, "").HPEXPIRE(this.#redis_key_revoked, token_id, expires_in_ms).EXEC();
236
229
  }
237
230
  } else console.warn("[ecwt] Redis client is not provided. Tokens cannot be revoked.");
238
231
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ecwt",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Encrypted CBOR Web Token",
5
5
  "publishConfig": {
6
6
  "access": "public"