@ctx-core/jwt 10.1.12 → 10.1.15
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.15
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @ctx-core/function: 20.9.1
|
|
8
|
+
|
|
9
|
+
## 10.1.14
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- @ctx-core: 20.9.0
|
|
14
|
+
|
|
15
|
+
## 10.1.13
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- fix: jwt*token_exp*: jwt_token: return null when raw jwt_token does not have '.' format
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
- @ctx-core/error@11.5.0
|
|
22
|
+
|
|
3
23
|
## 10.1.12
|
|
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.
|
|
3
|
+
"version": "10.1.15",
|
|
4
4
|
"description": "ctx-core jwt",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ctx-core",
|
|
@@ -25,17 +25,17 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@ctx-core/atob": "^10.0.57",
|
|
28
|
-
"@ctx-core/error": "^11.
|
|
29
|
-
"@ctx-core/function": "^20.
|
|
28
|
+
"@ctx-core/error": "^11.5.0",
|
|
29
|
+
"@ctx-core/function": "^20.9.1",
|
|
30
30
|
"@swc/cli": "^0.1.57",
|
|
31
|
-
"@swc/core": "^1.2.
|
|
31
|
+
"@swc/core": "^1.2.218"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"c8": "^7.
|
|
34
|
+
"c8": "^7.12.0",
|
|
35
35
|
"check-dts": "^0.6.7",
|
|
36
|
-
"
|
|
36
|
+
"tsx": "^3.8.0",
|
|
37
37
|
"typescript": "next",
|
|
38
|
-
"uvu": "^0.5.
|
|
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": "
|
|
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
|
}
|
package/src/_types/JwtToken.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
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,
|
package/src/jwt_token_exp_.d.ts
CHANGED
package/src/jwt_token_exp_.js
CHANGED
|
@@ -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
|
|
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, }
|