Skip to content

Commit 5f11b53

Browse files
committed
wip
1 parent 3bba0f1 commit 5f11b53

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

.changeset/purple-colts-guess.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@saleor/app-sdk": patch
3+
---
4+
5+
WIP

src/verify-jwt.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ export const verifyJWT = async ({
6161

6262
const JWKS = jose.createRemoteJWKSet(new URL(getJwksUrlFromSaleorApiUrl(saleorApiUrl)));
6363
debug("Trying to compare JWKS with token");
64-
await jose.jwtVerify(token, JWKS);
64+
await jose.jwtVerify(token, JWKS, {
65+
crit: {
66+
b64: true,
67+
},
68+
});
6569
} catch (e) {
6670
debug("Failure: %s", e);
6771
debug("Will return with Bad Request");

src/verify-signature.ts

+6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ export const verifySignatureFromApiUrl = async (
2323
protected: header,
2424
payload: rawBody,
2525
signature: jwsSignature,
26+
header: {
27+
b64: true,
28+
},
2629
};
2730

2831
const remoteJwks = jose.createRemoteJWKSet(
@@ -52,6 +55,9 @@ export const verifySignatureWithJwks = async (jwks: string, signature: string, r
5255
protected: header,
5356
payload: rawBody,
5457
signature: jwsSignature,
58+
header: {
59+
b64: true,
60+
},
5561
};
5662

5763
let localJwks: jose.FlattenedVerifyGetKey;

0 commit comments

Comments
 (0)