diff --git a/.changeset/nextjs-export-handle-sso-callback.md b/.changeset/nextjs-export-handle-sso-callback.md new file mode 100644 index 00000000000..30429841167 --- /dev/null +++ b/.changeset/nextjs-export-handle-sso-callback.md @@ -0,0 +1,5 @@ +--- +'@clerk/nextjs': patch +--- + +Export `` from `@clerk/nextjs`. Previously, importing it from `@clerk/nextjs` failed, so it could not be used on the SSO callback route of a custom flow. diff --git a/packages/nextjs/src/__tests__/__snapshots__/exports.test.ts.snap b/packages/nextjs/src/__tests__/__snapshots__/exports.test.ts.snap new file mode 100644 index 00000000000..a2035d67fe0 --- /dev/null +++ b/packages/nextjs/src/__tests__/__snapshots__/exports.test.ts.snap @@ -0,0 +1,64 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`root public exports > should not change unexpectedly 1`] = ` +[ + "APIKeys", + "AuthenticateWithRedirectCallback", + "ClerkDegraded", + "ClerkFailed", + "ClerkLoaded", + "ClerkLoading", + "ClerkProvider", + "CreateOrganization", + "GoogleOneTap", + "HandleSSOCallback", + "InviteMembersButton", + "OAuthConsent", + "OAuthDeviceVerification", + "OrganizationList", + "OrganizationProfile", + "OrganizationSwitcher", + "PricingTable", + "Protect", + "RedirectToCreateOrganization", + "RedirectToOrganizationProfile", + "RedirectToSignIn", + "RedirectToSignUp", + "RedirectToTasks", + "RedirectToUserProfile", + "Show", + "SignIn", + "SignInButton", + "SignInWithMetamaskButton", + "SignOutButton", + "SignUp", + "SignUpButton", + "SignedIn", + "SignedOut", + "TaskChooseOrganization", + "TaskResetPassword", + "TaskSetupMFA", + "UNSAFE_PortalProvider", + "UserAvatar", + "UserButton", + "UserProfile", + "Waitlist", + "getToken", + "useAPIKeys", + "useAuth", + "useClerk", + "useEmailLink", + "useOAuthConsent", + "useOAuthDeviceVerification", + "useOrganization", + "useOrganizationCreationDefaults", + "useOrganizationList", + "useReverification", + "useSession", + "useSessionList", + "useSignIn", + "useSignUp", + "useUser", + "useWaitlist", +] +`; diff --git a/packages/nextjs/src/__tests__/exports.test.ts b/packages/nextjs/src/__tests__/exports.test.ts new file mode 100644 index 00000000000..41322a14366 --- /dev/null +++ b/packages/nextjs/src/__tests__/exports.test.ts @@ -0,0 +1,9 @@ +import { describe, expect, it } from 'vitest'; + +import * as publicExports from '../index'; + +describe('root public exports', () => { + it('should not change unexpectedly', () => { + expect(Object.keys(publicExports).sort()).toMatchSnapshot(); + }); +}); diff --git a/packages/nextjs/src/index.ts b/packages/nextjs/src/index.ts index 585129c82d7..a01e34a1195 100644 --- a/packages/nextjs/src/index.ts +++ b/packages/nextjs/src/index.ts @@ -25,6 +25,7 @@ export { APIKeys, CreateOrganization, GoogleOneTap, + HandleSSOCallback, InviteMembersButton, OAuthConsent, OAuthDeviceVerification, diff --git a/packages/nextjs/vitest.config.mts b/packages/nextjs/vitest.config.mts index ffe3c21de12..f5467dcc036 100644 --- a/packages/nextjs/vitest.config.mts +++ b/packages/nextjs/vitest.config.mts @@ -1,7 +1,14 @@ +import { fileURLToPath } from 'node:url'; + import { defineConfig } from 'vitest/config'; export default defineConfig({ plugins: [], + resolve: { + alias: { + '#components': fileURLToPath(new URL('./src/components.client.ts', import.meta.url)), + }, + }, test: { typecheck: { enabled: true,