Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/poor-cycles-dress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@clerk/remix": minor
---

Remove `machineSecretKey` option. Please migrate to `@clerk/react-router` instead.

Migration guide: https://reactrouter.com/upgrading/remix
React Router SDK: https://clerk.com/docs/quickstarts/react-router
5 changes: 2 additions & 3 deletions packages/remix/src/ssr/authenticateRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import { patchRequest } from './utils';

export async function authenticateRequest(
args: LoaderFunctionArgs,
opts: AuthenticateRequestOptions,
opts: Omit<AuthenticateRequestOptions, 'machineSecretKey'>,
): Promise<SignedInState | SignedOutState> {
const { request } = args;
const { audience, authorizedParties } = opts;

const { apiUrl, secretKey, jwtKey, proxyUrl, isSatellite, domain, publishableKey, machineSecretKey } = opts;
const { apiUrl, secretKey, jwtKey, proxyUrl, isSatellite, domain, publishableKey } = opts;
const { signInUrl, signUpUrl, afterSignInUrl, afterSignUpUrl } = opts;

const requestState = await createClerkClient({
Expand All @@ -32,7 +32,6 @@ export async function authenticateRequest(
signUpUrl,
afterSignInUrl,
afterSignUpUrl,
machineSecretKey,
});

const locationHeader = requestState.headers.get(constants.Headers.Location);
Expand Down
2 changes: 0 additions & 2 deletions packages/remix/src/ssr/loadOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export const loadOptions = (args: LoaderFunctionArgs, overrides: RootAuthLoaderO
// 3. Then try from globalThis (Cloudflare Workers).
// 4. Then from loader context (Cloudflare Pages).
const secretKey = overrides.secretKey || getEnvVariable('CLERK_SECRET_KEY', context) || '';
const machineSecretKey = overrides.machineSecretKey || getEnvVariable('CLERK_MACHINE_SECRET_KEY', context);
const publishableKey = overrides.publishableKey || getEnvVariable('CLERK_PUBLISHABLE_KEY', context) || '';
const jwtKey = overrides.jwtKey || getEnvVariable('CLERK_JWT_KEY', context);
const apiUrl = getEnvVariable('CLERK_API_URL', context) || apiUrlFromPublishableKey(publishableKey);
Expand Down Expand Up @@ -70,7 +69,6 @@ export const loadOptions = (args: LoaderFunctionArgs, overrides: RootAuthLoaderO
// used to append options that are not initialized from env
...overrides,
secretKey,
machineSecretKey,
publishableKey,
jwtKey,
apiUrl,
Expand Down
4 changes: 0 additions & 4 deletions packages/remix/src/ssr/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ export type RootAuthLoaderOptions = {
publishableKey?: string;
jwtKey?: string;
secretKey?: string;
/**
* Used to override the CLERK_MACHINE_SECRET_KEY env variable if needed.
*/
machineSecretKey?: string;
/**
* @deprecated Use [session token claims](https://clerk.com/docs/backend-requests/making/custom-session-token) instead.
*/
Expand Down
Loading