diff --git a/.changeset/correct-backend-reference-prerequisites.md b/.changeset/correct-backend-reference-prerequisites.md new file mode 100644 index 00000000000..f304ed455b2 --- /dev/null +++ b/.changeset/correct-backend-reference-prerequisites.md @@ -0,0 +1,5 @@ +--- +'@clerk/backend': patch +--- + +Correct the documented Directory Sync prerequisites for `updateOrganization()` and clarify that `verifyToken()` requires `secretKey` whenever `jwtKey` is omitted, including when JWKS is cached. diff --git a/packages/backend/src/api/endpoints/OrganizationApi.ts b/packages/backend/src/api/endpoints/OrganizationApi.ts index d1ee8d859e2..e7b69887a69 100644 --- a/packages/backend/src/api/endpoints/OrganizationApi.ts +++ b/packages/backend/src/api/endpoints/OrganizationApi.ts @@ -67,13 +67,11 @@ export type GetOrganizationParams = ( /** @inline */ export type UpdateParams = { /** - * Lets Organization admins set up enterprise SSO in ``. Requires Clerk - * Organizations to be enabled for the instance and a [Pro or Business plan](/pricing) in production. + * Lets Organization admins set up enterprise SSO in ``. Requires Clerk Organizations to be enabled for the instance and a [Pro or Business plan](https://clerk.com/pricing) in production. */ selfServeSsoEnabled?: boolean; /** - * Lets Organization admins set up Directory Sync in ``. Requires self-serve - * SSO for the Organization, an SSO connection, and a [Pro or Business plan](/pricing) in production. + * Lets Organization admins set up Directory Sync in ``. Requires Clerk Organizations to be enabled for the instance, an SSO connection, and a [Pro or Business plan](https://clerk.com/pricing) in production. */ selfServeDirectorySyncEnabled?: boolean; /** The name to update the Organization with. */ diff --git a/packages/backend/src/tokens/verify.ts b/packages/backend/src/tokens/verify.ts index a3fa6f02fb4..8535363aa6b 100644 --- a/packages/backend/src/tokens/verify.ts +++ b/packages/backend/src/tokens/verify.ts @@ -45,7 +45,7 @@ export type VerifyTokenOptions = Simplify< * > [!WARNING] * > This is a lower-level method intended for more advanced use-cases. It's recommended to use [`authenticateRequest()`](https://clerk.com/docs/reference/backend/authenticate-request), which fully authenticates a token passed from the `request` object. * - * Verifies a Clerk-generated token signature. Networkless if the `jwtKey` is provided. Otherwise, performs a network call to retrieve the JWKS from the [Backend API](https://clerk.com/docs/reference/backend-api/tag/jwks/GET/jwks){{ target: '_blank' }}. + * Verifies a Clerk-generated token signature. Networkless if `jwtKey` is provided. Otherwise, it requires `secretKey` and makes a network call to retrieve the JWKS from the [Backend API](https://clerk.com/docs/reference/backend-api/tag/jwks/GET/jwks){{ target: '_blank' }} when the key isn't cached. * * @param token - The token to verify. * @param options - Options for verifying the token. It is recommended to set these options as [environment variables](/docs/guides/development/clerk-environment-variables#api-and-sdk-configuration) where possible, and then pass them to the function. For example, you can set the `secretKey` option using the `CLERK_SECRET_KEY` environment variable, and then pass it to the function like this: `verifyToken(token, { secretKey: process.env.CLERK_SECRET_KEY })`.