Skip to content

Commit

Permalink
fix(clerk-sdk-node): Add jwtKey in api envs and use it redwood compat…
Browse files Browse the repository at this point in the history
…ibility
  • Loading branch information
dimkl committed Jul 3, 2023
1 parent fb42638 commit 7f02182
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/sdk-node/src/clerkClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ export function Clerk(options: ClerkOptions) {

const createBasePropForRedwoodCompatibility = () => {
const verifySessionToken = (token: string) => {
const { jwtKey } = loadApiEnv();
const { payload } = decodeJwt(token);
return _verifyToken(token, {
issuer: payload.iss,
jwtKey: process.env.CLERK_JWT_KEY,
jwtKey,
});
};
return { base: { verifySessionToken } };
Expand Down
1 change: 1 addition & 0 deletions packages/sdk-node/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ export const loadApiEnv = () => {
proxyUrl: process.env.CLERK_PROXY_URL || '',
signInUrl: process.env.CLERK_SIGN_IN_URL || '',
isSatellite: process.env.CLERK_IS_SATELLITE === 'true',
jwtKey: process.env.CLERK_JWT_KEY || '',
};
};

0 comments on commit 7f02182

Please sign in to comment.