@ctx-core/jwt 10.0.28 → 10.0.33
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/.swcrc +1 -1
- package/CHANGELOG.md +54 -0
- package/dist/JwtToken.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/jwt_token_exp_.js.map +1 -1
- package/dist/validate_current_jwt.js.map +1 -1
- package/package.json +7 -7
- package/src/JwtToken.ts +1 -1
- package/src/index.ts +1 -1
- package/src/jwt_token_exp_.ts +1 -1
- package/src/validate_current_jwt.ts +1 -1
package/.swcrc
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,59 @@
|
|
|
1
1
|
# @ctx-core/jwt
|
|
2
2
|
|
|
3
|
+
## 10.0.33
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @swc/core: ^1.2.113 -> ^1.2.116
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @ctx-core/atob@10.0.28
|
|
10
|
+
- @ctx-core/error@11.1.4
|
|
11
|
+
- @ctx-core/function@20.2.8
|
|
12
|
+
|
|
13
|
+
## 10.0.32
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- @swc/cli: ^0.1.51 -> ^0.1.52
|
|
18
|
+
- @swc/core: ^1.2.111 -> ^1.2.113
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
- @ctx-core/atob@10.0.27
|
|
22
|
+
- @ctx-core/error@11.1.3
|
|
23
|
+
- @ctx-core/function@20.2.7
|
|
24
|
+
|
|
25
|
+
## 10.0.31
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- @swc/core: ^1.2.110 -> ^1.2.111
|
|
30
|
+
- Updated dependencies
|
|
31
|
+
- @ctx-core/atob@10.0.26
|
|
32
|
+
- @ctx-core/error@11.1.2
|
|
33
|
+
- @ctx-core/function@20.2.6
|
|
34
|
+
|
|
35
|
+
## 10.0.30
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- typescript: ^4.4.4 -> ^4.5.2
|
|
40
|
+
- @swc/core: ^1.2.108 -> ^1.2.110
|
|
41
|
+
- Updated dependencies
|
|
42
|
+
- Updated dependencies
|
|
43
|
+
- @ctx-core/atob@10.0.25
|
|
44
|
+
- @ctx-core/error@11.0.20
|
|
45
|
+
- @ctx-core/function@20.2.5
|
|
46
|
+
|
|
47
|
+
## 10.0.29
|
|
48
|
+
|
|
49
|
+
### Patch Changes
|
|
50
|
+
|
|
51
|
+
- @swc/core: ^1.2.107 -> ^1.2.108
|
|
52
|
+
- Updated dependencies
|
|
53
|
+
- @ctx-core/atob@10.0.24
|
|
54
|
+
- @ctx-core/error@11.0.19
|
|
55
|
+
- @ctx-core/function@20.2.4
|
|
56
|
+
|
|
3
57
|
## 10.0.28
|
|
4
58
|
|
|
5
59
|
### Patch Changes
|
package/dist/JwtToken.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/JwtToken.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"sources":["../src/JwtToken.ts"],"sourcesContent":["import type { error_ctx_I } from '@ctx-core/error'\nimport type { maybe, nullish } from '@ctx-core/function'\nexport interface Token {\n\taccess_token: string\n\ttoken_type: string\n\tid_token?:string\n\temail?:string\n\terror?:maybe<error_ctx_I, nullish>\n}\n"],"names":[],"mappings":"AAAA,MAAM"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './header_authorization_jwt_token_.js'\nexport * from './
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './header_authorization_jwt_token_.js'\nexport * from './jwt_error_ctx_I.js'\nexport * from './jwt_token_exp_.js'\nexport * from './JwtToken.js'\nexport * from './validate_current_jwt.js'\n"],"names":[],"mappings":"cAAc,CAAsC;cACtC,CAAsB;cACtB,CAAqB;cACrB,CAAe;cACf,CAA2B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/jwt_token_exp_.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../src/jwt_token_exp_.ts"],"sourcesContent":["import { atob_ } from '@ctx-core/atob'\nimport type { nullish } from '@ctx-core/function'\nexport function jwt_token_exp_(jwt_token:string|nullish):number {\n\tconst atob = atob_()\n\tconst jwt_data = jwt_token && JSON.parse(atob(jwt_token.split('.')[1]))\n\treturn jwt_data?.exp\n}\nexport {\n\tjwt_token_exp_ as _jwt_token_exp,\n\tjwt_token_exp_ as _exp__jwt_token,\n}\n"],"names":["atob_","jwt_token_exp_","jwt_token","atob","jwt_data","JSON","parse","split","exp","_jwt_token_exp","_exp__jwt_token"],"mappings":"AAAA,MAAM,GAAGA,KAAK,QAAQ,CAAgB;AAEtC,MAAM,UAAUC,cAAc,CAACC,SAAwB,EAAS,CAAC;IAChE,KAAK,CAACC,IAAI,GAAGH,KAAK;IAClB,KAAK,CAACI,QAAQ,GAAGF,SAAS,IAAIG,IAAI,CAACC,KAAK,CAACH,IAAI,CAACD,SAAS,CAACK,KAAK,CAAC,CAAG,IAAE,CAAC;IACpE,MAAM,CAACH,QAAQ,aAARA,QAAQ,KAARA,IAAI,CAAJA,CAAa,GAAbA,IAAI,CAAJA,CAAa,GAAbA,QAAQ,CAAEI,GAAG;AACrB,CAAC;AACD,MAAM,GACLP,cAAc,IAAIQ,cAAc,EAChCR,cAAc,IAAIS,eAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/validate_current_jwt.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../src/validate_current_jwt.ts"],"sourcesContent":["import { throw_bad_credentials } from '@ctx-core/error'\nimport type { nullish } from '@ctx-core/function'\nimport type { jwt_error_ctx_I } from './jwt_error_ctx_I.js'\nimport { jwt_token_exp_ } from './jwt_token_exp_.js'\nexport function validate_current_jwt(jwt_token:string|nullish):void {\n\tconst jwt_token_exp = jwt_token_exp_(jwt_token)\n\tconst jwt_token_exp_millis = jwt_token_exp * 1000\n\tif (Date.now() > jwt_token_exp_millis) {\n\t\tthrow_bad_credentials({\n\t\t\tjwt_token,\n\t\t\terror_message: 'Session Expired'\n\t\t} as jwt_error_ctx_I)\n\t}\n}\nexport {\n\tvalidate_current_jwt as validate__current__jwt\n}\n"],"names":["throw_bad_credentials","jwt_token_exp_","validate_current_jwt","jwt_token","jwt_token_exp","jwt_token_exp_millis","Date","now","error_message","validate__current__jwt"],"mappings":"AAAA,MAAM,GAAGA,qBAAqB,QAAQ,CAAiB;AAGvD,MAAM,GAAGC,cAAc,QAAQ,CAAqB;AACpD,MAAM,UAAUC,oBAAoB,CAACC,SAAwB,EAAO,CAAC;IACpE,KAAK,CAACC,aAAa,GAAGH,cAAc,CAACE,SAAS;IAC9C,KAAK,CAACE,oBAAoB,GAAGD,aAAa,GAAG,IAAI;IACjD,EAAE,EAAEE,IAAI,CAACC,GAAG,KAAKF,oBAAoB,EAAE,CAAC;QACvCL,qBAAqB,CAAC,CAAC;YACtBG,SAAS;YACTK,aAAa,EAAE,CAAiB;QACjC,CAAC;IACF,CAAC;AACF,CAAC;AACD,MAAM,GACLN,oBAAoB,IAAIO,sBAAsB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ctx-core/jwt",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.33",
|
|
4
4
|
"description": "ctx-core jwt",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ctx-core",
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
"./package.json": "./package.json"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@ctx-core/atob": "^10.0.
|
|
32
|
-
"@ctx-core/error": "^11.
|
|
33
|
-
"@ctx-core/function": "^20.2.
|
|
34
|
-
"@swc/cli": "^0.1.
|
|
35
|
-
"@swc/core": "^1.2.
|
|
31
|
+
"@ctx-core/atob": "^10.0.28",
|
|
32
|
+
"@ctx-core/error": "^11.1.4",
|
|
33
|
+
"@ctx-core/function": "^20.2.8",
|
|
34
|
+
"@swc/cli": "^0.1.52",
|
|
35
|
+
"@swc/core": "^1.2.116"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"typescript": "
|
|
38
|
+
"typescript": "next"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public",
|
package/src/JwtToken.ts
CHANGED
package/src/index.ts
CHANGED
package/src/jwt_token_exp_.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { nullish } from '@ctx-core/function'
|
|
2
1
|
import { atob_ } from '@ctx-core/atob'
|
|
2
|
+
import type { nullish } from '@ctx-core/function'
|
|
3
3
|
export function jwt_token_exp_(jwt_token:string|nullish):number {
|
|
4
4
|
const atob = atob_()
|
|
5
5
|
const jwt_data = jwt_token && JSON.parse(atob(jwt_token.split('.')[1]))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { nullish } from '@ctx-core/function'
|
|
2
1
|
import { throw_bad_credentials } from '@ctx-core/error'
|
|
2
|
+
import type { nullish } from '@ctx-core/function'
|
|
3
3
|
import type { jwt_error_ctx_I } from './jwt_error_ctx_I.js'
|
|
4
4
|
import { jwt_token_exp_ } from './jwt_token_exp_.js'
|
|
5
5
|
export function validate_current_jwt(jwt_token:string|nullish):void {
|