@payello-module/jwt 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/JWT.js +2 -2
- package/package.json +1 -1
package/dist/JWT.js
CHANGED
@@ -49,11 +49,11 @@ export class JWT {
|
|
49
49
|
if (bits.length !== 3) {
|
50
50
|
throw new JwtError(`Invalid number of parts in JWT string. Expected 3 but got ${bits.length}`);
|
51
51
|
}
|
52
|
-
const header = JSON.parse(bits[0]);
|
52
|
+
const header = JSON.parse(atob(bits[0]));
|
53
53
|
if (!header || !header.typ || header.typ !== "JWT") {
|
54
54
|
throw new JwtError("Header invalid or type is not JWT");
|
55
55
|
}
|
56
|
-
const payload = JSON.parse(bits[1]);
|
56
|
+
const payload = JSON.parse(atob(bits[1]));
|
57
57
|
if (!payload || !payload.jti) {
|
58
58
|
throw new JwtError("Payload invalid or missing jti value");
|
59
59
|
}
|