Skip to content

Commit 15839df

Browse files
committed
fix(clerk-sdk-node): Fix missing audience key in sdk-node authenticateRequest
1 parent 4997688 commit 15839df

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

packages/sdk-node/src/authenticateRequest.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const authenticateRequest = (opts: {
4747
}) => {
4848
const { clerkClient, apiKey, secretKey, frontendApi, publishableKey, req, options } = opts;
4949
const cookies = parseCookies(req);
50-
const { jwtKey, authorizedParties } = options || {};
50+
const { jwtKey, authorizedParties, audience } = options || {};
5151

5252
const requestUrl = getRequestUrl(req);
5353
const isSatellite =
@@ -68,6 +68,7 @@ export const authenticateRequest = (opts: {
6868
}
6969

7070
return clerkClient.authenticateRequest({
71+
audience,
7172
apiKey,
7273
secretKey,
7374
frontendApi,

packages/sdk-node/src/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { AuthObject, SignedInAuthObject } from '@clerk/backend';
1+
import type { AuthenticateRequestOptions, AuthObject, SignedInAuthObject } from '@clerk/backend';
22
import type { MultiDomainAndOrProxy } from '@clerk/types';
33
import type { NextFunction, Request, Response } from 'express';
44

@@ -29,6 +29,7 @@ export type ClerkMiddleware = MiddlewareWithAuthProp | MiddlewareRequireAuthProp
2929
export type ClerkMiddlewareOptions = {
3030
onError?: (error: any) => unknown;
3131
authorizedParties?: string[];
32+
audience?: AuthenticateRequestOptions['audience'];
3233
jwtKey?: string;
3334
strict?: boolean;
3435
signInUrl?: string;

0 commit comments

Comments
 (0)