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
2 changes: 1 addition & 1 deletion packages/backend/src/api/endpoints/JwtTemplatesApi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ClerkPaginationRequest } from '@clerk/shared/types';
import { joinPaths } from 'src/util/path';
import { joinPaths } from '../../util/path';

import type { DeletedObject, JwtTemplate } from '../resources';
import type { PaginatedResourceResponse } from '../resources/Deserializer';
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/api/endpoints/WaitlistEntryApi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ClerkPaginationRequest } from '@clerk/shared/types';
import { joinPaths } from 'src/util/path';
import { joinPaths } from '../../util/path';

import type { DeletedObject } from '../resources/DeletedObject';
import type { PaginatedResourceResponse } from '../resources/Deserializer';
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/jwt/cryptoKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { isomorphicAtob } from '@clerk/shared/isomorphicAtob';
import { runtime } from '../runtime';

// https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#pkcs_8_import
function pemToBuffer(secret: string): ArrayBuffer {
function pemToBuffer(secret: string): Uint8Array<ArrayBuffer> {
const trimmed = secret
.replace(/-----BEGIN.*?-----/g, '')
.replace(/-----END.*?-----/g, '')
Expand Down
7 changes: 6 additions & 1 deletion packages/backend/src/jwt/verifyJwt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ export async function hasValidSignature(jwt: Jwt, key: JsonWebKey | string): Pro
try {
const cryptoKey = await importKey(key, algorithm, 'verify');

const verified = await runtime.crypto.subtle.verify(algorithm.name, cryptoKey, signature, data);
const verified = await runtime.crypto.subtle.verify(
algorithm.name,
cryptoKey,
signature as Uint8Array<ArrayBuffer>,
data,
);
return { data: verified };
} catch (error) {
return {
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/tokens/__tests__/getAuth.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expectTypeOf, test } from 'vitest';
import { expectTypeOf, test, describe } from 'vitest';

import type { RedirectFun } from '../../createRedirect';
import type { AuthObject, InvalidTokenAuthObject } from '../authObjects';
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/webhooks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getEnvVariable } from '@clerk/shared/getEnvVariable';
import { errorThrower } from 'src/util/shared';
import { Webhook } from 'standardwebhooks';
import { errorThrower } from './util/shared';

import type { WebhookEvent } from './api/resources/Webhooks';

Expand Down
1 change: 0 additions & 1 deletion packages/backend/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"baseUrl": ".",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"importHelpers": true,
Expand Down
Loading