From 18257267dc612d1f3a5580df647c2f34cd97f6cd Mon Sep 17 00:00:00 2001 From: Flawn Date: Tue, 31 Oct 2023 00:04:02 +0300 Subject: [PATCH] feat(backend): Also export token-related errors --- .changeset/spotty-pears-fold.md | 5 +++++ packages/backend/src/tokens/index.ts | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .changeset/spotty-pears-fold.md diff --git a/.changeset/spotty-pears-fold.md b/.changeset/spotty-pears-fold.md new file mode 100644 index 00000000000..3e878b3c3f9 --- /dev/null +++ b/.changeset/spotty-pears-fold.md @@ -0,0 +1,5 @@ +--- +'@clerk/backend': minor +--- + +Expose token verification error types to the user, to enable more granular error handling when manually verifying tokens with Clerk. diff --git a/packages/backend/src/tokens/index.ts b/packages/backend/src/tokens/index.ts index e59e37af657..4c28a1fc124 100644 --- a/packages/backend/src/tokens/index.ts +++ b/packages/backend/src/tokens/index.ts @@ -1,7 +1,8 @@ export * from './authObjects'; +export * from './errors'; export * from './factory'; -export type { RequestState } from './authStatus'; export { AuthStatus } from './authStatus'; +export type { RequestState } from './authStatus'; export { loadInterstitialFromLocal } from './interstitial'; -export type { AuthenticateRequestOptions, OptionalVerifyTokenOptions, RequiredVerifyTokenOptions } from './request'; export { debugRequestState } from './request'; +export type { AuthenticateRequestOptions, OptionalVerifyTokenOptions, RequiredVerifyTokenOptions } from './request';