Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
chore: revert machine ids
  • Loading branch information
wobsoriano committed Jun 10, 2025
commit 992601902e3506f8b5fdc739895a46a03ec58a67
2 changes: 1 addition & 1 deletion packages/backend/src/fixtures/machine.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const mockTokens = {
api_key: 'ak_LCWGdaM8mv8K4PC/57IICZQXAeWfCgF30DZaFXHoGn9=',
oauth_token: 'oat_8XOIucKvqHVr5tYP123456789abcdefghij',
machine_token: 'm2m_8XOIucKvqHVr5tYP123456789abcdefghij',
machine_token: 'mt_8XOIucKvqHVr5tYP123456789abcdefghij',
} as const;

export const mockVerificationResults = {
Expand Down
6 changes: 3 additions & 3 deletions packages/backend/src/tokens/__tests__/verify.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ describe('tokens.verifyMachineAuthToken(token, options)', () => {
});

it('verifies provided Machine token', async () => {
const token = 'm2m_8XOIucKvqHVr5tYP123456789abcdefghij';
const token = 'mt_8XOIucKvqHVr5tYP123456789abcdefghij';

server.use(
http.post(
Expand Down Expand Up @@ -199,7 +199,7 @@ describe('tokens.verifyMachineAuthToken(token, options)', () => {

describe('handles API errors for M2M tokens', () => {
it('handles invalid token', async () => {
const token = 'm2m_invalid_token';
const token = 'mt_invalid_token';

server.use(
http.post('https://api.clerk.test/m2m_tokens/verify', () => {
Expand All @@ -220,7 +220,7 @@ describe('tokens.verifyMachineAuthToken(token, options)', () => {
});

it('handles unexpected error', async () => {
const token = 'm2m_ey966f1b1xf93586b2debdcadb0b3bd1';
const token = 'mt_ey966f1b1xf93586b2debdcadb0b3bd1';

server.use(
http.post('https://api.clerk.test/m2m_tokens/verify', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/tokens/machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { AuthenticateRequestOptions } from '../tokens/types';
import type { MachineTokenType } from './tokenTypes';
import { TokenType } from './tokenTypes';

export const M2M_TOKEN_PREFIX = 'm2m_';
export const M2M_TOKEN_PREFIX = 'mt_';
export const OAUTH_TOKEN_PREFIX = 'oat_';
export const API_KEY_PREFIX = 'ak_';

Expand Down
Loading