shelving 1.160.0 → 1.160.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/util/jwt.js +3 -3
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "state-management",
12
12
  "query-builder"
13
13
  ],
14
- "version": "1.160.0",
14
+ "version": "1.160.1",
15
15
  "repository": "https://github.com/dhoulb/shelving",
16
16
  "author": "Dave Houlbrooke <dave@shax.com>",
17
17
  "license": "0BSD",
package/util/jwt.js CHANGED
@@ -34,9 +34,9 @@ export async function encodeToken({ nbf = "now", iat = "now", exp = DAY * 30, ..
34
34
  const header = encodeBase64URL(JSON.stringify(HEADER));
35
35
  // Encode payload.
36
36
  const payload = encodeBase64URL(JSON.stringify({
37
- nbf: requireDate(nbf).getTime() / 1000, // By JWT convention, times are in seconds.
38
- iat: requireDate(iat).getTime() / 1000, // By JWT convention, times are in seconds.
39
- exp: (Date.now() + exp) / 1000, // By JWT convention, times are in seconds.
37
+ nbf: Math.round(requireDate(nbf).getTime() / 1000), // By JWT convention, times are in seconds.
38
+ iat: Math.round(requireDate(iat).getTime() / 1000), // By JWT convention, times are in seconds.
39
+ exp: Math.round((Date.now() + exp) / 1000), // By JWT convention, times are in seconds.
40
40
  ...claims,
41
41
  }));
42
42
  // Create signature.