@ctx-core/jwt 10.1.11 → 10.1.14

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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @ctx-core/jwt
2
2
 
3
+ ## 10.1.14
4
+
5
+ ### Patch Changes
6
+
7
+ - @ctx-core: 20.9.0
8
+
9
+ ## 10.1.13
10
+
11
+ ### Patch Changes
12
+
13
+ - fix: jwt*token_exp*: jwt_token: return null when raw jwt_token does not have '.' format
14
+ - Updated dependencies
15
+ - @ctx-core/error@11.5.0
16
+
17
+ ## 10.1.12
18
+
19
+ ### Patch Changes
20
+
21
+ - @ctx-core/atob: ^10.0.56 -> ^10.0.57
22
+
3
23
  ## 10.1.11
4
24
 
5
25
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctx-core/jwt",
3
- "version": "10.1.11",
3
+ "version": "10.1.14",
4
4
  "description": "ctx-core jwt",
5
5
  "keywords": [
6
6
  "ctx-core",
@@ -24,18 +24,18 @@
24
24
  "./package.json": "./package.json"
25
25
  },
26
26
  "dependencies": {
27
- "@ctx-core/atob": "^10.0.56",
28
- "@ctx-core/error": "^11.4.7",
29
- "@ctx-core/function": "^20.8.0",
27
+ "@ctx-core/atob": "^10.0.57",
28
+ "@ctx-core/error": "^11.5.0",
29
+ "@ctx-core/function": "^20.9.0",
30
30
  "@swc/cli": "^0.1.57",
31
- "@swc/core": "^1.2.178"
31
+ "@swc/core": "^1.2.218"
32
32
  },
33
33
  "devDependencies": {
34
- "c8": "^7.11.2",
34
+ "c8": "^7.12.0",
35
35
  "check-dts": "^0.6.7",
36
- "tsm": "^2.2.1",
36
+ "tsx": "^3.8.0",
37
37
  "typescript": "next",
38
- "uvu": "^0.5.3"
38
+ "uvu": "^0.5.6"
39
39
  },
40
40
  "publishConfig": {
41
41
  "access": "public",
@@ -47,7 +47,7 @@
47
47
  "clean": ":",
48
48
  "exec": "$@",
49
49
  "test": "pnpm test-unit && check-dts",
50
- "test-unit": "tsm node_modules/uvu/bin.js . '\\.test\\.(ts|js)$'",
50
+ "test-unit": "tsx node_modules/uvu/bin.js . '\\.test\\.(ts|js)$'",
51
51
  "test-unit-coverage": "c8 pnpm test-unit"
52
52
  }
53
53
  }
@@ -1,5 +1,5 @@
1
1
  import type { error_ctx_I } from '@ctx-core/error'
2
- import type { nullish } from '@ctx-core/function'
2
+ import { type nullish } from '@ctx-core/function'
3
3
  export interface JwtToken {
4
4
  access_token:string
5
5
  token_type:string
@@ -1,4 +1,4 @@
1
- import type { nullish } from '@ctx-core/function'
1
+ import { type nullish } from '@ctx-core/function'
2
2
  export declare function header_authorization_jwt_token_(authorization:string|nullish):string|null
3
3
  export {
4
4
  header_authorization_jwt_token_ as _header_authorization_jwt_token,
@@ -1,3 +1,3 @@
1
- import type { nullish } from '@ctx-core/function'
1
+ import { type nullish } from '@ctx-core/function'
2
2
  export declare function jwt_token_exp_(jwt_token:string|nullish):number|null
3
3
  export { jwt_token_exp_ as _jwt_token_exp, jwt_token_exp_ as _exp__jwt_token, }
@@ -6,7 +6,9 @@ import { atob_ } from '@ctx-core/atob'
6
6
  export function jwt_token_exp_(jwt_token) {
7
7
  const atob = atob_()
8
8
  if (!jwt_token) return null
9
- const jwt_data = JSON.parse(atob(jwt_token.split('.')[1]))
9
+ const atob_jwt_data = jwt_token.split('.')[1]
10
+ if (!atob_jwt_data) return null
11
+ const jwt_data = JSON.parse(atob(atob_jwt_data))
10
12
  return jwt_data?.exp
11
13
  }
12
14
  export { jwt_token_exp_ as _jwt_token_exp, jwt_token_exp_ as _exp__jwt_token, }
@@ -1,3 +1,3 @@
1
- import type { nullish } from '@ctx-core/function'
1
+ import { type nullish } from '@ctx-core/function'
2
2
  export declare function validate_current_jwt(jwt_token:string|nullish):void
3
3
  export { validate_current_jwt as validate__current__jwt }
package/COMMIT_EDITMSG DELETED
@@ -1,5 +0,0 @@
1
-
2
-
3
-
4
-
5
-