@payello-module/jwt 1.20240419.2346 → 1.20240922.121
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/JWT.d.ts +1 -1
- package/dist/JWT.js +3 -2
- package/dist/JwtHeader.d.ts +1 -0
- package/package.json +1 -1
package/dist/JWT.d.ts
CHANGED
@@ -23,7 +23,7 @@ export declare class JWT {
|
|
23
23
|
* @param key - The key for signing the JWT
|
24
24
|
* @returns A promise that resolves to the signed JWT string.
|
25
25
|
*/
|
26
|
-
static sign(payload: JWTPayload, alg: JWTAlgorithm, key: string | BufferSource): Promise<string>;
|
26
|
+
static sign(payload: JWTPayload, alg: JWTAlgorithm, key: string | BufferSource, kid?: string): Promise<string>;
|
27
27
|
/**
|
28
28
|
* Extracts and returns the header, payload, and signature components from a JWT string.
|
29
29
|
* @param input - The JWT string to be parsed.
|
package/dist/JWT.js
CHANGED
@@ -40,12 +40,13 @@ export class JWT {
|
|
40
40
|
* @param key - The key for signing the JWT
|
41
41
|
* @returns A promise that resolves to the signed JWT string.
|
42
42
|
*/
|
43
|
-
static async sign(payload, alg, key) {
|
43
|
+
static async sign(payload, alg, key, kid) {
|
44
44
|
if (typeof JWTAlgorithms[alg] == "undefined")
|
45
45
|
throw new JwtError("Unknown algorithm");
|
46
46
|
const _header = {
|
47
47
|
typ: 'JWT',
|
48
|
-
alg: alg
|
48
|
+
alg: alg,
|
49
|
+
kid: kid
|
49
50
|
};
|
50
51
|
const body = base64_encode_urlsafe(JSON.stringify(_header)) +
|
51
52
|
"." +
|
package/dist/JwtHeader.d.ts
CHANGED
package/package.json
CHANGED