Skip to content

Commit

Permalink
fix(backend): Move tokens/jwt.ts to tokens/jwt/verifyJwt.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkl committed May 26, 2023
1 parent 6a27bb7 commit 94e2732
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions packages/backend/src/tokens/jwt/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { hasValidSignature, decodeJwt, verifyJwt } from './verifyJwt';

export type { VerifyJwtOptions } from './verifyJwt';
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type QUnit from 'qunit';
import sinon from 'sinon';

import { mockJwks, mockJwt, mockJwtHeader, mockJwtPayload } from './fixtures';
import { decodeJwt, verifyJwt } from './jwt';
import { mockJwks, mockJwt, mockJwtHeader, mockJwtPayload } from '../fixtures';
import { decodeJwt, verifyJwt } from './verifyJwt';

export default (QUnit: QUnit) => {
const { module, test } = QUnit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import type { Jwt, JwtPayload } from '@clerk/types';

// DO NOT CHANGE: Runtime needs to be imported as a default export so that we can stub its dependencies with Sinon.js
// For more information refer to https://sinonjs.org/how-to/stub-dependency/
import runtime from '../runtime';
import { base64url } from '../util/rfc4648';
import { TokenVerificationError, TokenVerificationErrorAction, TokenVerificationErrorReason } from './errors';
import runtime from '../../runtime';
import { base64url } from '../../util/rfc4648';
import { TokenVerificationError, TokenVerificationErrorAction, TokenVerificationErrorReason } from '../errors';

type IssuerResolver = string | ((iss: string) => boolean);

Expand Down
4 changes: 2 additions & 2 deletions packages/backend/tests/suites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import requestTest from './dist/tokens/request.test.js';
import keysTest from './dist/tokens/keys.test.js';
import pathTest from './dist/util/path.test.js';
import verifyTest from './dist/tokens/verify.test.js';
import jwtTest from './dist/tokens/jwt.test.js';
import verifyJwtTest from './dist/tokens/jwt/verifyJwt.test.js';

import utilRequestTest from './dist/util/request.test.js';
import factoryTest from './dist/api/factory.test.js';
Expand All @@ -23,7 +23,7 @@ const suites = [
keysTest,
verifyTest,
pathTest,
jwtTest,
verifyJwtTest,
factoryTest,
redirectTest,
];
Expand Down

0 comments on commit 94e2732

Please sign in to comment.