Skip to content

Commit

Permalink
old method (deprecated Privy)
Browse files Browse the repository at this point in the history
  • Loading branch information
artlu99 committed Nov 3, 2024
1 parent ebc4caa commit 761c3f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion functions/getSassyHashes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ const getFid = async (privyAuthToken: string, env: Env): Promise<number> => {
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}.`);
Expand Down

0 comments on commit 761c3f4

Please sign in to comment.