From b731e75a9bc8ba1424f0f43c31ed0dd18ac7f4bf Mon Sep 17 00:00:00 2001 From: serafettin Date: Tue, 6 Feb 2024 16:51:32 +0100 Subject: [PATCH] Update index.js --- api/src/libs/lit/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/libs/lit/index.js b/api/src/libs/lit/index.js index c50f5d32..458d5404 100644 --- a/api/src/libs/lit/index.js +++ b/api/src/libs/lit/index.js @@ -125,7 +125,7 @@ export const getPKPSession = async (session, index) => { throw new Error("Unauthenticated DID"); } - const sessionCacheKey = `${session.did.parent}:${index.signerFunction}` + const sessionCacheKey = `${session.did.parent}:${index.id}:${index.signerFunction}` const existingSessionStr = await redis.hGet("sessions", sessionCacheKey); @@ -184,7 +184,7 @@ export const getPKPSession = async (session, index) => { return null; } - if(! resp.signatures.sig1 ){ + if(!resp.signatures || !resp.signatures.sig1 ){ throw new Error("No signature returned") }