Stringify jwk
This commit is contained in:
parent
a0580038a3
commit
b4f28bc225
2 changed files with 3 additions and 3 deletions
|
@ -75,12 +75,12 @@ export class MangroveReviews {
|
|||
payload = MangroveReviews.cleanPayload(payload)
|
||||
const algo = 'ES256'
|
||||
const kid = await MangroveReviews.publicToPem(keypair.publicKey)
|
||||
const jwk = await crypto.subtle.exportKey('jwk', keypair.publicKey)
|
||||
const jwk = JSON.stringify(await crypto.subtle.exportKey('jwk', keypair.publicKey))
|
||||
return await new SignJWT(<JWTPayload>payload)
|
||||
.setProtectedHeader({
|
||||
alg: algo,
|
||||
kid,
|
||||
jwk,
|
||||
jwk: <any> jwk,
|
||||
enc: "utf-8"
|
||||
})
|
||||
.sign(keypair.privateKey);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "mangrove-reviews-typescript",
|
||||
"version": "0.0.5",
|
||||
"version": "0.0.6",
|
||||
"description": "A library to interface with Mangrove.reviews",
|
||||
"main": "lib/index.ts",
|
||||
"scripts": {
|
||||
|
|
Loading…
Reference in a new issue