diff --git a/sw_scripts/safari-notifications.js b/sw_scripts/safari-notifications.js index 9cf8be944..a2ae0192e 100644 --- a/sw_scripts/safari-notifications.js +++ b/sw_scripts/safari-notifications.js @@ -129,6 +129,7 @@ function bufferFromBase64(base64) { issuer: did, signer, }); + console.error(jwt); return jwt; } @@ -283,8 +284,9 @@ function bufferFromBase64(base64) { return async function(data) { const privateKey = Secp256k1.uint256(privateKeyBytes, 16); const hash = await sha256(data); + console.error("sha256", hash); const digest = Secp256k1.uint256(hash, 16); - console.error(privateKey, digest); + const signature = Secp256k1.ecsign(privateKey, digest); const sigR = Secp256k1.uint256(signature.r,16); const sigS = Secp256k1.uint256(signature.s,16); @@ -446,7 +448,14 @@ async function getNotificationCount() { }; headers["Authorization"] = "Bearer " + await accessToken(identifier); - + + let response = await fetch("https://test-api.endorser.ch/api/v2/report/claims", { + method: 'GET', + headers: headers, + }); + console.error(did, response.status); + console.error(await response.json()); + result = decrypted; break;