Skip to content

Commit 4eeabba

Browse files
committed
fix(clerk-sdk-node): Add jwtKey in api envs and use it redwood compatibility
1 parent f0b044c commit 4eeabba

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

.changeset/lucky-panthers-draw.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/clerk-sdk-node': patch
3+
---
4+
5+
Load `jwtKey` from `CLERK_JWT_KEY` env variable

packages/sdk-node/src/clerkClient.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ export function Clerk(options: ClerkOptions) {
3030

3131
const createBasePropForRedwoodCompatibility = () => {
3232
const verifySessionToken = (token: string) => {
33+
const { jwtKey } = loadApiEnv();
3334
const { payload } = decodeJwt(token);
3435
return _verifyToken(token, {
3536
issuer: payload.iss,
36-
jwtKey: process.env.CLERK_JWT_KEY,
37+
jwtKey,
3738
});
3839
};
3940
return { base: { verifySessionToken } };

packages/sdk-node/src/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,6 @@ export const loadApiEnv = () => {
3232
proxyUrl: process.env.CLERK_PROXY_URL || '',
3333
signInUrl: process.env.CLERK_SIGN_IN_URL || '',
3434
isSatellite: process.env.CLERK_IS_SATELLITE === 'true',
35+
jwtKey: process.env.CLERK_JWT_KEY || '',
3536
};
3637
};

0 commit comments

Comments
 (0)