From 761c3f4597f8c190eb13b83c3bed0b789b6f2cad Mon Sep 17 00:00:00 2001 From: artlu99 Date: Sat, 2 Nov 2024 22:49:02 -0400 Subject: [PATCH] old method (deprecated Privy) --- functions/getSassyHashes/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/functions/getSassyHashes/index.ts b/functions/getSassyHashes/index.ts index 44a1f89..f8cc24a 100644 --- a/functions/getSassyHashes/index.ts +++ b/functions/getSassyHashes/index.ts @@ -21,9 +21,11 @@ const getFid = async (privyAuthToken: string, env: Env): Promise => { const privy = new PrivyClient(env.REACT_APP_PRIVY_APP_ID, env.PRIVY_APP_SECRET); try { - const user = await privy.getUser({ idToken: privyAuthToken }); + const verifiedClaims = await privy.verifyAuthToken(privyAuthToken); + const user = await privy.getUser(verifiedClaims.userId); console.log('Privy User:', user); + // const user2 = await privy.getUser({ idToken: IDTokenFromCookies(request) }); return user?.farcaster?.fid; } catch (error) { console.error(`Token verification failed with error ${error}.`);