@clerk/nextjs 7.1.0-snapshot.v20260413174426 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,7 +39,7 @@ __export(utils_exports, {
39
39
  module.exports = __toCommonJS(utils_exports);
40
40
  var import_server = require("next/server");
41
41
  var _a, _b;
42
- const CLERK_USE_CACHE_MARKER = Symbol.for("clerk_use_cache_error");
42
+ const CLERK_USE_CACHE_MARKER = /* @__PURE__ */ Symbol.for("clerk_use_cache_error");
43
43
  class ClerkUseCacheError extends (_b = Error, _a = CLERK_USE_CACHE_MARKER, _b) {
44
44
  constructor(message, originalError) {
45
45
  super(message);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/app-router/server/utils.ts"],"sourcesContent":["import { NextRequest } from 'next/server';\n\nconst CLERK_USE_CACHE_MARKER = Symbol.for('clerk_use_cache_error');\n\n/**\n * Custom error class for \"use cache\" errors with a symbol marker to prevent double-wrapping.\n */\nexport class ClerkUseCacheError extends Error {\n readonly [CLERK_USE_CACHE_MARKER] = true;\n\n constructor(\n message: string,\n public readonly originalError?: Error,\n ) {\n super(message);\n this.name = 'ClerkUseCacheError';\n }\n}\n\nexport const isClerkUseCacheError = (e: unknown): e is ClerkUseCacheError => {\n return e instanceof Error && CLERK_USE_CACHE_MARKER in e;\n};\n\n// Patterns for Next.js \"use cache\" errors - tightened to reduce false positives\n// Matches both \"use cache\" (double quotes) and 'use cache' (single quotes)\nconst USE_CACHE_WITH_DYNAMIC_API_PATTERN =\n /inside\\s+[\"']use cache[\"']|[\"']use cache[\"'].*(?:headers|cookies)|(?:headers|cookies).*[\"']use cache[\"']/i;\nconst CACHE_SCOPE_PATTERN = /cache scope/i;\nconst DYNAMIC_DATA_SOURCE_PATTERN = /dynamic data source/i;\n// https://github.com/vercel/next.js/pull/61332\nconst ROUTE_BAILOUT_PATTERN = /Route .*? needs to bail out of prerendering at this point because it used .*?./;\n\nexport const isPrerenderingBailout = (e: unknown) => {\n if (!(e instanceof Error) || !('message' in e)) {\n return false;\n }\n\n const { message } = e;\n const lowerCaseInput = message.toLowerCase();\n\n return (\n ROUTE_BAILOUT_PATTERN.test(message) ||\n lowerCaseInput.includes('dynamic server usage') ||\n lowerCaseInput.includes('this page needs to bail out of prerendering') ||\n lowerCaseInput.includes('during prerendering')\n );\n};\n\n/**\n * Detects Next.js errors from using dynamic APIs (headers/cookies) inside \"use cache\".\n */\nexport const isNextjsUseCacheError = (e: unknown): boolean => {\n if (!(e instanceof Error)) {\n return false;\n }\n\n const { message } = e;\n\n // \"use cache\" with dynamic API context (e.g., 'used `headers()` inside \"use cache\"')\n if (USE_CACHE_WITH_DYNAMIC_API_PATTERN.test(message)) {\n return true;\n }\n\n // \"cache scope\" with dynamic data source (e.g., 'Dynamic data sources inside a cache scope')\n if (CACHE_SCOPE_PATTERN.test(message) && DYNAMIC_DATA_SOURCE_PATTERN.test(message)) {\n return true;\n }\n\n return false;\n};\n\nexport const USE_CACHE_ERROR_MESSAGE =\n `Clerk: auth() and currentUser() cannot be called inside a \"use cache\" function. ` +\n `These functions access \\`headers()\\` internally, which is a dynamic API not allowed in cached contexts.\\n\\n` +\n `To fix this, call auth() outside the cached function and pass the values you need as arguments:\\n\\n` +\n ` import { auth, clerkClient } from '@clerk/nextjs/server';\\n\\n` +\n ` async function getCachedUser(userId: string) {\\n` +\n ` \"use cache\";\\n` +\n ` const client = await clerkClient();\\n` +\n ` return client.users.getUser(userId);\\n` +\n ` }\\n\\n` +\n ` // In your component/page:\\n` +\n ` const { userId } = await auth();\\n` +\n ` if (userId) {\\n` +\n ` const user = await getCachedUser(userId);\\n` +\n ` }`;\n\nexport async function buildRequestLike(): Promise<NextRequest> {\n try {\n // @ts-expect-error - Dynamically import to avoid breaking Next 12 apps\n const { headers } = await import('next/headers');\n const resolvedHeaders = await headers();\n return new NextRequest('https://placeholder.com', { headers: resolvedHeaders });\n } catch (e: any) {\n // https://nextjs.org/docs/messages/ppr-caught-error\n if (e && isPrerenderingBailout(e)) {\n throw e;\n }\n\n if (e && isNextjsUseCacheError(e)) {\n throw new ClerkUseCacheError(`${USE_CACHE_ERROR_MESSAGE}\\n\\nOriginal error: ${e.message}`, e);\n }\n\n throw new Error(\n `Clerk: auth(), currentUser() and clerkClient(), are only supported in App Router (/app directory).\\nIf you're using /pages, try getAuth() instead.\\nOriginal error: ${e}`,\n );\n }\n}\n\n// Original source: https://github.com/vercel/next.js/blob/canary/packages/next/src/server/app-render/get-script-nonce-from-header.tsx\nexport function getScriptNonceFromHeader(cspHeaderValue: string): string | undefined {\n const directives = cspHeaderValue\n // Directives are split by ';'.\n .split(';')\n .map(directive => directive.trim());\n\n // First try to find the directive for the 'script-src', otherwise try to\n // fallback to the 'default-src'.\n const directive =\n directives.find(dir => dir.startsWith('script-src')) || directives.find(dir => dir.startsWith('default-src'));\n\n // If no directive could be found, then we're done.\n if (!directive) {\n return;\n }\n\n // Extract the nonce from the directive\n const nonce = directive\n .split(' ')\n // Remove the 'strict-src'/'default-src' string, this can't be the nonce.\n .slice(1)\n .map(source => source.trim())\n // Find the first source with the 'nonce-' prefix.\n .find(source => source.startsWith(\"'nonce-\") && source.length > 8 && source.endsWith(\"'\"))\n // Grab the nonce by trimming the 'nonce-' prefix.\n ?.slice(7, -1);\n\n // If we couldn't find the nonce, then we're done.\n if (!nonce) {\n return;\n }\n\n // Don't accept the nonce value if it contains HTML escape characters.\n // Technically, the spec requires a base64'd value, but this is just an\n // extra layer.\n if (/[&><\\u2028\\u2029]/g.test(nonce)) {\n throw new Error(\n 'Nonce value from Content-Security-Policy contained invalid HTML escape characters, which is disallowed for security reasons. Make sure that your nonce value does not contain the following characters: `<`, `>`, `&`',\n );\n }\n\n return nonce;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA4B;AAA5B;AAEA,MAAM,yBAAyB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QAAI,KAAK,sBAAsB,CAAC,GAAG;AACjC,YAAM;AAAA,IACR;AAEA,QAAI,KAAK,sBAAsB,CAAC,GAAG;AACjC,YAAM,IAAI,mBAAmB,GAAG,uBAAuB;AAAA;AAAA,kBAAuB,EAAE,OAAO,IAAI,CAAC;AAAA,IAC9F;AAEA,UAAM,IAAI;AAAA,MACR;AAAA;AAAA,kBAAuK,CAAC;AAAA,IAC1K;AAAA,EACF;AACF;AAGO,SAAS,yBAAyB,gBAA4C;AA9GrF,MAAAA;AA+GE,QAAM,aAAa,eAEhB,MAAM,GAAG,EACT,IAAI,CAAAC,eAAaA,WAAU,KAAK,CAAC;AAIpC,QAAM,YACJ,WAAW,KAAK,SAAO,IAAI,WAAW,YAAY,CAAC,KAAK,WAAW,KAAK,SAAO,IAAI,WAAW,aAAa,CAAC;AAG9G,MAAI,CAAC,WAAW;AACd;AAAA,EACF;AAGA,QAAM,SAAQD,MAAA,UACX,MAAM,GAAG,EAET,MAAM,CAAC,EACP,IAAI,YAAU,OAAO,KAAK,CAAC,EAE3B,KAAK,YAAU,OAAO,WAAW,SAAS,KAAK,OAAO,SAAS,KAAK,OAAO,SAAS,GAAG,CAAC,MAN7E,gBAAAA,IAQV,MAAM,GAAG;AAGb,MAAI,CAAC,OAAO;AACV;AAAA,EACF;AAKA,MAAI,qBAAqB,KAAK,KAAK,GAAG;AACpC,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;","names":["_a","directive"]}
1
+ {"version":3,"sources":["../../../../src/app-router/server/utils.ts"],"sourcesContent":["import { NextRequest } from 'next/server';\n\nconst CLERK_USE_CACHE_MARKER = Symbol.for('clerk_use_cache_error');\n\n/**\n * Custom error class for \"use cache\" errors with a symbol marker to prevent double-wrapping.\n */\nexport class ClerkUseCacheError extends Error {\n readonly [CLERK_USE_CACHE_MARKER] = true;\n\n constructor(\n message: string,\n public readonly originalError?: Error,\n ) {\n super(message);\n this.name = 'ClerkUseCacheError';\n }\n}\n\nexport const isClerkUseCacheError = (e: unknown): e is ClerkUseCacheError => {\n return e instanceof Error && CLERK_USE_CACHE_MARKER in e;\n};\n\n// Patterns for Next.js \"use cache\" errors - tightened to reduce false positives\n// Matches both \"use cache\" (double quotes) and 'use cache' (single quotes)\nconst USE_CACHE_WITH_DYNAMIC_API_PATTERN =\n /inside\\s+[\"']use cache[\"']|[\"']use cache[\"'].*(?:headers|cookies)|(?:headers|cookies).*[\"']use cache[\"']/i;\nconst CACHE_SCOPE_PATTERN = /cache scope/i;\nconst DYNAMIC_DATA_SOURCE_PATTERN = /dynamic data source/i;\n// https://github.com/vercel/next.js/pull/61332\nconst ROUTE_BAILOUT_PATTERN = /Route .*? needs to bail out of prerendering at this point because it used .*?./;\n\nexport const isPrerenderingBailout = (e: unknown) => {\n if (!(e instanceof Error) || !('message' in e)) {\n return false;\n }\n\n const { message } = e;\n const lowerCaseInput = message.toLowerCase();\n\n return (\n ROUTE_BAILOUT_PATTERN.test(message) ||\n lowerCaseInput.includes('dynamic server usage') ||\n lowerCaseInput.includes('this page needs to bail out of prerendering') ||\n lowerCaseInput.includes('during prerendering')\n );\n};\n\n/**\n * Detects Next.js errors from using dynamic APIs (headers/cookies) inside \"use cache\".\n */\nexport const isNextjsUseCacheError = (e: unknown): boolean => {\n if (!(e instanceof Error)) {\n return false;\n }\n\n const { message } = e;\n\n // \"use cache\" with dynamic API context (e.g., 'used `headers()` inside \"use cache\"')\n if (USE_CACHE_WITH_DYNAMIC_API_PATTERN.test(message)) {\n return true;\n }\n\n // \"cache scope\" with dynamic data source (e.g., 'Dynamic data sources inside a cache scope')\n if (CACHE_SCOPE_PATTERN.test(message) && DYNAMIC_DATA_SOURCE_PATTERN.test(message)) {\n return true;\n }\n\n return false;\n};\n\nexport const USE_CACHE_ERROR_MESSAGE =\n `Clerk: auth() and currentUser() cannot be called inside a \"use cache\" function. ` +\n `These functions access \\`headers()\\` internally, which is a dynamic API not allowed in cached contexts.\\n\\n` +\n `To fix this, call auth() outside the cached function and pass the values you need as arguments:\\n\\n` +\n ` import { auth, clerkClient } from '@clerk/nextjs/server';\\n\\n` +\n ` async function getCachedUser(userId: string) {\\n` +\n ` \"use cache\";\\n` +\n ` const client = await clerkClient();\\n` +\n ` return client.users.getUser(userId);\\n` +\n ` }\\n\\n` +\n ` // In your component/page:\\n` +\n ` const { userId } = await auth();\\n` +\n ` if (userId) {\\n` +\n ` const user = await getCachedUser(userId);\\n` +\n ` }`;\n\nexport async function buildRequestLike(): Promise<NextRequest> {\n try {\n // @ts-expect-error - Dynamically import to avoid breaking Next 12 apps\n const { headers } = await import('next/headers');\n const resolvedHeaders = await headers();\n return new NextRequest('https://placeholder.com', { headers: resolvedHeaders });\n } catch (e: any) {\n // https://nextjs.org/docs/messages/ppr-caught-error\n if (e && isPrerenderingBailout(e)) {\n throw e;\n }\n\n if (e && isNextjsUseCacheError(e)) {\n throw new ClerkUseCacheError(`${USE_CACHE_ERROR_MESSAGE}\\n\\nOriginal error: ${e.message}`, e);\n }\n\n throw new Error(\n `Clerk: auth(), currentUser() and clerkClient(), are only supported in App Router (/app directory).\\nIf you're using /pages, try getAuth() instead.\\nOriginal error: ${e}`,\n );\n }\n}\n\n// Original source: https://github.com/vercel/next.js/blob/canary/packages/next/src/server/app-render/get-script-nonce-from-header.tsx\nexport function getScriptNonceFromHeader(cspHeaderValue: string): string | undefined {\n const directives = cspHeaderValue\n // Directives are split by ';'.\n .split(';')\n .map(directive => directive.trim());\n\n // First try to find the directive for the 'script-src', otherwise try to\n // fallback to the 'default-src'.\n const directive =\n directives.find(dir => dir.startsWith('script-src')) || directives.find(dir => dir.startsWith('default-src'));\n\n // If no directive could be found, then we're done.\n if (!directive) {\n return;\n }\n\n // Extract the nonce from the directive\n const nonce = directive\n .split(' ')\n // Remove the 'strict-src'/'default-src' string, this can't be the nonce.\n .slice(1)\n .map(source => source.trim())\n // Find the first source with the 'nonce-' prefix.\n .find(source => source.startsWith(\"'nonce-\") && source.length > 8 && source.endsWith(\"'\"))\n // Grab the nonce by trimming the 'nonce-' prefix.\n ?.slice(7, -1);\n\n // If we couldn't find the nonce, then we're done.\n if (!nonce) {\n return;\n }\n\n // Don't accept the nonce value if it contains HTML escape characters.\n // Technically, the spec requires a base64'd value, but this is just an\n // extra layer.\n if (/[&><\\u2028\\u2029]/g.test(nonce)) {\n throw new Error(\n 'Nonce value from Content-Security-Policy contained invalid HTML escape characters, which is disallowed for security reasons. Make sure that your nonce value does not contain the following characters: `<`, `>`, `&`',\n );\n }\n\n return nonce;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA4B;AAA5B;AAEA,MAAM,yBAAyB,uBAAO,IAAI,uBAAuB;AAK1D,MAAM,4BAA2B,YAC5B,6BAD4B,IAAM;AAAA,EAG5C,YACE,SACgB,eAChB;AACA,UAAM,OAAO;AAFG;AAJlB,SAAU,MAA0B;AAOlC,SAAK,OAAO;AAAA,EACd;AACF;AAEO,MAAM,uBAAuB,CAAC,MAAwC;AAC3E,SAAO,aAAa,SAAS,0BAA0B;AACzD;AAIA,MAAM,qCACJ;AACF,MAAM,sBAAsB;AAC5B,MAAM,8BAA8B;AAEpC,MAAM,wBAAwB;AAEvB,MAAM,wBAAwB,CAAC,MAAe;AACnD,MAAI,EAAE,aAAa,UAAU,EAAE,aAAa,IAAI;AAC9C,WAAO;AAAA,EACT;AAEA,QAAM,EAAE,QAAQ,IAAI;AACpB,QAAM,iBAAiB,QAAQ,YAAY;AAE3C,SACE,sBAAsB,KAAK,OAAO,KAClC,eAAe,SAAS,sBAAsB,KAC9C,eAAe,SAAS,6CAA6C,KACrE,eAAe,SAAS,qBAAqB;AAEjD;AAKO,MAAM,wBAAwB,CAAC,MAAwB;AAC5D,MAAI,EAAE,aAAa,QAAQ;AACzB,WAAO;AAAA,EACT;AAEA,QAAM,EAAE,QAAQ,IAAI;AAGpB,M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IAQV,MAAM,GAAG;AAGb,MAAI,CAAC,OAAO;AACV;AAAA,EACF;AAKA,MAAI,qBAAqB,KAAK,KAAK,GAAG;AACpC,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;","names":["_a","directive"]}
@@ -33,7 +33,6 @@ __export(uiComponents_exports, {
33
33
  CreateOrganization: () => import_react3.CreateOrganization,
34
34
  GoogleOneTap: () => import_react3.GoogleOneTap,
35
35
  HandleSSOCallback: () => import_react3.HandleSSOCallback,
36
- OAuthConsent: () => import_internal.OAuthConsent,
37
36
  OrganizationList: () => import_react3.OrganizationList,
38
37
  OrganizationProfile: () => OrganizationProfile,
39
38
  OrganizationSwitcher: () => import_react3.OrganizationSwitcher,
@@ -57,7 +56,6 @@ var import_react = require("@clerk/react");
57
56
  var import_react2 = __toESM(require("react"));
58
57
  var import_useEnforceRoutingProps = require("./hooks/useEnforceRoutingProps");
59
58
  var import_react3 = require("@clerk/react");
60
- var import_internal = require("@clerk/react/internal");
61
59
  const UserProfile = Object.assign(
62
60
  (props) => {
63
61
  return /* @__PURE__ */ import_react2.default.createElement(import_react.UserProfile, { ...(0, import_useEnforceRoutingProps.useEnforceCorrectRoutingProps)("UserProfile", props) });
@@ -82,7 +80,6 @@ const SignUp = (props) => {
82
80
  CreateOrganization,
83
81
  GoogleOneTap,
84
82
  HandleSSOCallback,
85
- OAuthConsent,
86
83
  OrganizationList,
87
84
  OrganizationProfile,
88
85
  OrganizationSwitcher,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/client-boundary/uiComponents.tsx"],"sourcesContent":["'use client';\n\nimport {\n OrganizationProfile as BaseOrganizationProfile,\n SignIn as BaseSignIn,\n SignUp as BaseSignUp,\n UserProfile as BaseUserProfile,\n} from '@clerk/react';\nimport type { ComponentProps } from 'react';\nimport React from 'react';\n\nimport { useEnforceCorrectRoutingProps } from './hooks/useEnforceRoutingProps';\n\nexport {\n APIKeys,\n CreateOrganization,\n GoogleOneTap,\n OrganizationList,\n OrganizationSwitcher,\n PricingTable,\n SignInButton,\n SignInWithMetamaskButton,\n SignOutButton,\n SignUpButton,\n TaskChooseOrganization,\n TaskResetPassword,\n TaskSetupMFA,\n UserAvatar,\n UserButton,\n Waitlist,\n HandleSSOCallback,\n} from '@clerk/react';\n\nexport { OAuthConsent } from '@clerk/react/internal';\n\n// The assignment of UserProfile with BaseUserProfile props is used\n// to support the CustomPage functionality (eg UserProfile.Page)\n// Also the `typeof BaseUserProfile` is used to resolve the following error:\n// \"The inferred type of 'UserProfile' cannot be named without a reference to ...\"\nexport const UserProfile: typeof BaseUserProfile = Object.assign(\n (props: ComponentProps<typeof BaseUserProfile>) => {\n return <BaseUserProfile {...useEnforceCorrectRoutingProps('UserProfile', props)} />;\n },\n { ...BaseUserProfile },\n);\n\n// The assignment of OrganizationProfile with BaseOrganizationProfile props is used\n// to support the CustomPage functionality (eg OrganizationProfile.Page)\n// Also the `typeof BaseOrganizationProfile` is used to resolved the following error:\n// \"The inferred type of 'OrganizationProfile' cannot be named without a reference to ...\"\nexport const OrganizationProfile: typeof BaseOrganizationProfile = Object.assign(\n (props: ComponentProps<typeof BaseOrganizationProfile>) => {\n return <BaseOrganizationProfile {...useEnforceCorrectRoutingProps('OrganizationProfile', props)} />;\n },\n { ...BaseOrganizationProfile },\n);\n\nexport const SignIn = (props: ComponentProps<typeof BaseSignIn>) => {\n return <BaseSignIn {...useEnforceCorrectRoutingProps('SignIn', props, false)} />;\n};\n\nexport const SignUp = (props: ComponentProps<typeof BaseSignUp>) => {\n return <BaseSignUp {...useEnforceCorrectRoutingProps('SignUp', props, false)} />;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAKO;AAEP,IAAAA,gBAAkB;AAElB,oCAA8C;AAE9C,IAAAA,gBAkBO;AAEP,sBAA6B;AAMtB,MAAM,cAAsC,OAAO;AAAA,EACxD,CAAC,UAAkD;AACjD,WAAO,8BAAAC,QAAA,cAAC,aAAAC,aAAA,EAAiB,OAAG,6DAA8B,eAAe,KAAK,GAAG;AAAA,EACnF;AAAA,EACA,EAAE,GAAG,aAAAA,YAAgB;AACvB;AAMO,MAAM,sBAAsD,OAAO;AAAA,EACxE,CAAC,UAA0D;AACzD,WAAO,8BAAAD,QAAA,cAAC,aAAAE,qBAAA,EAAyB,OAAG,6DAA8B,uBAAuB,KAAK,GAAG;AAAA,EACnG;AAAA,EACA,EAAE,GAAG,aAAAA,oBAAwB;AAC/B;AAEO,MAAM,SAAS,CAAC,UAA6C;AAClE,SAAO,8BAAAF,QAAA,cAAC,aAAAG,QAAA,EAAY,OAAG,6DAA8B,UAAU,OAAO,KAAK,GAAG;AAChF;AAEO,MAAM,SAAS,CAAC,UAA6C;AAClE,SAAO,8BAAAH,QAAA,cAAC,aAAAI,QAAA,EAAY,OAAG,6DAA8B,UAAU,OAAO,KAAK,GAAG;AAChF;","names":["import_react","React","BaseUserProfile","BaseOrganizationProfile","BaseSignIn","BaseSignUp"]}
1
+ {"version":3,"sources":["../../../src/client-boundary/uiComponents.tsx"],"sourcesContent":["'use client';\n\nimport {\n OrganizationProfile as BaseOrganizationProfile,\n SignIn as BaseSignIn,\n SignUp as BaseSignUp,\n UserProfile as BaseUserProfile,\n} from '@clerk/react';\nimport type { ComponentProps } from 'react';\nimport React from 'react';\n\nimport { useEnforceCorrectRoutingProps } from './hooks/useEnforceRoutingProps';\n\nexport {\n APIKeys,\n CreateOrganization,\n GoogleOneTap,\n OrganizationList,\n OrganizationSwitcher,\n PricingTable,\n SignInButton,\n SignInWithMetamaskButton,\n SignOutButton,\n SignUpButton,\n TaskChooseOrganization,\n TaskResetPassword,\n TaskSetupMFA,\n UserAvatar,\n UserButton,\n Waitlist,\n HandleSSOCallback,\n} from '@clerk/react';\n\n// The assignment of UserProfile with BaseUserProfile props is used\n// to support the CustomPage functionality (eg UserProfile.Page)\n// Also the `typeof BaseUserProfile` is used to resolve the following error:\n// \"The inferred type of 'UserProfile' cannot be named without a reference to ...\"\nexport const UserProfile: typeof BaseUserProfile = Object.assign(\n (props: ComponentProps<typeof BaseUserProfile>) => {\n return <BaseUserProfile {...useEnforceCorrectRoutingProps('UserProfile', props)} />;\n },\n { ...BaseUserProfile },\n);\n\n// The assignment of OrganizationProfile with BaseOrganizationProfile props is used\n// to support the CustomPage functionality (eg OrganizationProfile.Page)\n// Also the `typeof BaseOrganizationProfile` is used to resolved the following error:\n// \"The inferred type of 'OrganizationProfile' cannot be named without a reference to ...\"\nexport const OrganizationProfile: typeof BaseOrganizationProfile = Object.assign(\n (props: ComponentProps<typeof BaseOrganizationProfile>) => {\n return <BaseOrganizationProfile {...useEnforceCorrectRoutingProps('OrganizationProfile', props)} />;\n },\n { ...BaseOrganizationProfile },\n);\n\nexport const SignIn = (props: ComponentProps<typeof BaseSignIn>) => {\n return <BaseSignIn {...useEnforceCorrectRoutingProps('SignIn', props, false)} />;\n};\n\nexport const SignUp = (props: ComponentProps<typeof BaseSignUp>) => {\n return <BaseSignUp {...useEnforceCorrectRoutingProps('SignUp', props, false)} />;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAKO;AAEP,IAAAA,gBAAkB;AAElB,oCAA8C;AAE9C,IAAAA,gBAkBO;AAMA,MAAM,cAAsC,OAAO;AAAA,EACxD,CAAC,UAAkD;AACjD,WAAO,8BAAAC,QAAA,cAAC,aAAAC,aAAA,EAAiB,OAAG,6DAA8B,eAAe,KAAK,GAAG;AAAA,EACnF;AAAA,EACA,EAAE,GAAG,aAAAA,YAAgB;AACvB;AAMO,MAAM,sBAAsD,OAAO;AAAA,EACxE,CAAC,UAA0D;AACzD,WAAO,8BAAAD,QAAA,cAAC,aAAAE,qBAAA,EAAyB,OAAG,6DAA8B,uBAAuB,KAAK,GAAG;AAAA,EACnG;AAAA,EACA,EAAE,GAAG,aAAAA,oBAAwB;AAC/B;AAEO,MAAM,SAAS,CAAC,UAA6C;AAClE,SAAO,8BAAAF,QAAA,cAAC,aAAAG,QAAA,EAAY,OAAG,6DAA8B,UAAU,OAAO,KAAK,GAAG;AAChF;AAEO,MAAM,SAAS,CAAC,UAA6C;AAClE,SAAO,8BAAAH,QAAA,cAAC,aAAAI,QAAA,EAAY,OAAG,6DAA8B,UAAU,OAAO,KAAK,GAAG;AAChF;","names":["import_react","React","BaseUserProfile","BaseOrganizationProfile","BaseSignIn","BaseSignUp"]}
@@ -19,17 +19,14 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  var internal_exports = {};
20
20
  __export(internal_exports, {
21
21
  MultisessionAppSupport: () => import_controlComponents.MultisessionAppSupport,
22
- OAuthConsent: () => import_uiComponents.OAuthConsent,
23
22
  useOAuthConsent: () => import_react.useOAuthConsent
24
23
  });
25
24
  module.exports = __toCommonJS(internal_exports);
26
25
  var import_controlComponents = require("./client-boundary/controlComponents");
27
- var import_uiComponents = require("./client-boundary/uiComponents");
28
26
  var import_react = require("@clerk/shared/react");
29
27
  // Annotate the CommonJS export names for ESM import in node:
30
28
  0 && (module.exports = {
31
29
  MultisessionAppSupport,
32
- OAuthConsent,
33
30
  useOAuthConsent
34
31
  });
35
32
  //# sourceMappingURL=internal.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/internal.ts"],"sourcesContent":["/**\n * These need to be explicitly listed. Do not use an * here.\n * If you do, app router will break.\n */\nexport { MultisessionAppSupport } from './client-boundary/controlComponents';\nexport { OAuthConsent } from './client-boundary/uiComponents';\nexport { useOAuthConsent } from '@clerk/shared/react';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,+BAAuC;AACvC,0BAA6B;AAC7B,mBAAgC;","names":[]}
1
+ {"version":3,"sources":["../../src/internal.ts"],"sourcesContent":["/**\n * These need to be explicitly listed. Do not use an * here.\n * If you do, app router will break.\n */\nexport { MultisessionAppSupport } from './client-boundary/controlComponents';\nexport { useOAuthConsent } from '@clerk/shared/react';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,+BAAuC;AACvC,mBAAgC;","names":[]}
@@ -58,7 +58,7 @@ const SIGN_IN_URL = process.env.NEXT_PUBLIC_CLERK_SIGN_IN_URL || "";
58
58
  const SIGN_UP_URL = process.env.NEXT_PUBLIC_CLERK_SIGN_UP_URL || "";
59
59
  const SDK_METADATA = {
60
60
  name: "@clerk/nextjs",
61
- version: "7.1.0-snapshot.v20260413174426",
61
+ version: "7.1.0",
62
62
  environment: process.env.NODE_ENV
63
63
  };
64
64
  const TELEMETRY_DISABLED = (0, import_underscore.isTruthy)(process.env.NEXT_PUBLIC_CLERK_TELEMETRY_DISABLED);
@@ -28,7 +28,7 @@ const clerkClientDefaultOptions = {
28
28
  publishableKey: import_constants.PUBLISHABLE_KEY,
29
29
  apiUrl: import_constants.API_URL,
30
30
  apiVersion: import_constants.API_VERSION,
31
- userAgent: `${"@clerk/nextjs"}@${"7.1.0-snapshot.v20260413174426"}`,
31
+ userAgent: `${"@clerk/nextjs"}@${"7.1.0"}`,
32
32
  proxyUrl: import_constants.PROXY_URL,
33
33
  domain: import_constants.DOMAIN,
34
34
  isSatellite: import_constants.IS_SATELLITE,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/server/createClerkClient.ts"],"sourcesContent":["import { createClerkClient } from '@clerk/backend';\n\nimport {\n API_URL,\n API_VERSION,\n DOMAIN,\n IS_SATELLITE,\n MACHINE_SECRET_KEY,\n PROXY_URL,\n PUBLISHABLE_KEY,\n SDK_METADATA,\n SECRET_KEY,\n TELEMETRY_DEBUG,\n TELEMETRY_DISABLED,\n} from './constants';\n\nconst clerkClientDefaultOptions = {\n secretKey: SECRET_KEY,\n publishableKey: PUBLISHABLE_KEY,\n apiUrl: API_URL,\n apiVersion: API_VERSION,\n userAgent: `${PACKAGE_NAME}@${PACKAGE_VERSION}`,\n proxyUrl: PROXY_URL,\n domain: DOMAIN,\n isSatellite: IS_SATELLITE,\n machineSecretKey: MACHINE_SECRET_KEY,\n sdkMetadata: SDK_METADATA,\n telemetry: {\n disabled: TELEMETRY_DISABLED,\n debug: TELEMETRY_DEBUG,\n },\n};\n\nexport const createClerkClientWithOptions: typeof createClerkClient = options =>\n createClerkClient({ ...clerkClientDefaultOptions, ...options });\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAkC;AAElC,uBAYO;AAEP,MAAM,4BAA4B;AAAA,EAChC,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,WAAW,GAAG,eAAY,IAAI,gCAAe;AAAA,EAC7C,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,WAAW;AAAA,IACT,UAAU;AAAA,IACV,OAAO;AAAA,EACT;AACF;AAEO,MAAM,+BAAyD,iBACpE,kCAAkB,EAAE,GAAG,2BAA2B,GAAG,QAAQ,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../../src/server/createClerkClient.ts"],"sourcesContent":["import { createClerkClient } from '@clerk/backend';\n\nimport {\n API_URL,\n API_VERSION,\n DOMAIN,\n IS_SATELLITE,\n MACHINE_SECRET_KEY,\n PROXY_URL,\n PUBLISHABLE_KEY,\n SDK_METADATA,\n SECRET_KEY,\n TELEMETRY_DEBUG,\n TELEMETRY_DISABLED,\n} from './constants';\n\nconst clerkClientDefaultOptions = {\n secretKey: SECRET_KEY,\n publishableKey: PUBLISHABLE_KEY,\n apiUrl: API_URL,\n apiVersion: API_VERSION,\n userAgent: `${PACKAGE_NAME}@${PACKAGE_VERSION}`,\n proxyUrl: PROXY_URL,\n domain: DOMAIN,\n isSatellite: IS_SATELLITE,\n machineSecretKey: MACHINE_SECRET_KEY,\n sdkMetadata: SDK_METADATA,\n telemetry: {\n disabled: TELEMETRY_DISABLED,\n debug: TELEMETRY_DEBUG,\n },\n};\n\nexport const createClerkClientWithOptions: typeof createClerkClient = options =>\n createClerkClient({ ...clerkClientDefaultOptions, ...options });\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAkC;AAElC,uBAYO;AAEP,MAAM,4BAA4B;AAAA,EAChC,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,WAAW,GAAG,eAAY,IAAI,OAAe;AAAA,EAC7C,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,WAAW;AAAA,IACT,UAAU;AAAA,IACV,OAAO;AAAA,EACT;AACF;AAEO,MAAM,+BAAyD,iBACpE,kCAAkB,EAAE,GAAG,2BAA2B,GAAG,QAAQ,CAAC;","names":[]}
@@ -90,7 +90,7 @@ function debugLogHeader(name) {
90
90
  return `[clerk debug start: ${name}]`;
91
91
  }
92
92
  function debugLogFooter(name) {
93
- return `[clerk debug end: ${name}] (@clerk/nextjs=${"7.1.0-snapshot.v20260413174426"},next=${import_package.default.version},timestamp=${Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3)})`;
93
+ return `[clerk debug end: ${name}] (@clerk/nextjs=${"7.1.0"},next=${import_package.default.version},timestamp=${Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3)})`;
94
94
  }
95
95
  function truncate(str, maxLength) {
96
96
  const encoder = new TextEncoder();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/debugLogger.ts"],"sourcesContent":["// TODO: Replace with a more sophisticated logging solution\n\nimport nextPkg from 'next/package.json';\n\nimport { logFormatter } from './logFormatter';\n\nexport type Log = string | Record<string, unknown>;\nexport type LogEntry = Log | Log[];\nexport type Logger<L = Log> = {\n commit: () => void;\n debug: (...args: Array<L | (() => L)>) => void;\n enable: () => void;\n};\nexport type LoggerNoCommit<L = Logger> = Omit<L, 'commit'>;\n\nexport const createDebugLogger = (name: string, formatter: (val: LogEntry) => string) => (): Logger => {\n const entries: LogEntry[] = [];\n let isEnabled = false;\n\n return {\n enable: () => {\n isEnabled = true;\n },\n debug: (...args) => {\n if (isEnabled) {\n entries.push(args.map(arg => (typeof arg === 'function' ? arg() : arg)));\n }\n },\n commit: () => {\n if (isEnabled) {\n console.log(debugLogHeader(name));\n\n /**\n * We buffer each collected log entry so we can format them and log them all at once.\n * Individual console.log calls are used to ensure we don't hit platform-specific log limits (Vercel and Netlify are 4kb).\n */\n for (const log of entries) {\n let output = formatter(log);\n\n output = output\n .split('\\n')\n .map(l => ` ${l}`)\n .join('\\n');\n\n // Vercel errors if the output is > 4kb, so we truncate it\n if (process.env.VERCEL) {\n output = truncate(output, 4096);\n }\n\n console.log(output);\n }\n\n console.log(debugLogFooter(name));\n }\n },\n };\n};\n\ntype WithLogger = <L extends Logger, H extends (...args: any[]) => any>(\n loggerFactoryOrName: string | (() => L),\n handlerCtor: (logger: LoggerNoCommit<L>) => H,\n) => H;\n\nexport const withLogger: WithLogger = (loggerFactoryOrName, handlerCtor) => {\n return ((...args: any) => {\n const factory =\n typeof loggerFactoryOrName === 'string'\n ? createDebugLogger(loggerFactoryOrName, logFormatter)\n : loggerFactoryOrName;\n\n const logger = factory();\n const handler = handlerCtor(logger as any);\n\n try {\n const res = handler(...args);\n if (typeof res === 'object' && 'then' in res && typeof res.then === 'function') {\n return res\n .then((val: any) => {\n logger.commit();\n return val;\n })\n .catch((err: any) => {\n logger.commit();\n throw err;\n });\n }\n // handle sync methods\n logger.commit();\n return res;\n } catch (err: any) {\n logger.commit();\n throw err;\n }\n }) as ReturnType<typeof handlerCtor>;\n};\n\nfunction debugLogHeader(name: string) {\n return `[clerk debug start: ${name}]`;\n}\n\nfunction debugLogFooter(name: string) {\n return `[clerk debug end: ${name}] (@clerk/nextjs=${PACKAGE_VERSION},next=${nextPkg.version},timestamp=${Math.round(new Date().getTime() / 1_000)})`;\n}\n\n// ref: https://stackoverflow.com/questions/57769465/javascript-truncate-text-by-bytes-length\nfunction truncate(str: string, maxLength: number) {\n const encoder = new TextEncoder();\n const decoder = new TextDecoder('utf-8');\n\n const encodedString = encoder.encode(str);\n const truncatedString = encodedString.slice(0, maxLength);\n\n // return the truncated string, removing any replacement characters that result from partially truncated characters\n return decoder.decode(truncatedString).replace(/\\uFFFD/g, '');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qBAAoB;AAEpB,0BAA6B;AAWtB,MAAM,oBAAoB,CAAC,MAAc,cAAyC,MAAc;AACrG,QAAM,UAAsB,CAAC;AAC7B,MAAI,YAAY;AAEhB,SAAO;AAAA,IACL,QAAQ,MAAM;AACZ,kBAAY;AAAA,IACd;AAAA,IACA,OAAO,IAAI,SAAS;AAClB,UAAI,WAAW;AACb,gBAAQ,KAAK,KAAK,IAAI,SAAQ,OAAO,QAAQ,aAAa,IAAI,IAAI,GAAI,CAAC;AAAA,MACzE;AAAA,IACF;AAAA,IACA,QAAQ,MAAM;AACZ,UAAI,WAAW;AACb,gBAAQ,IAAI,eAAe,IAAI,CAAC;AAMhC,mBAAW,OAAO,SAAS;AACzB,cAAI,SAAS,UAAU,GAAG;AAE1B,mBAAS,OACN,MAAM,IAAI,EACV,IAAI,OAAK,KAAK,CAAC,EAAE,EACjB,KAAK,IAAI;AAGZ,cAAI,QAAQ,IAAI,QAAQ;AACtB,qBAAS,SAAS,QAAQ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ugLogger.ts"],"sourcesContent":["// TODO: Replace with a more sophisticated logging solution\n\nimport nextPkg from 'next/package.json';\n\nimport { logFormatter } from './logFormatter';\n\nexport type Log = string | Record<string, unknown>;\nexport type LogEntry = Log | Log[];\nexport type Logger<L = Log> = {\n commit: () => void;\n debug: (...args: Array<L | (() => L)>) => void;\n enable: () => void;\n};\nexport type LoggerNoCommit<L = Logger> = Omit<L, 'commit'>;\n\nexport const createDebugLogger = (name: string, formatter: (val: LogEntry) => string) => (): Logger => {\n const entries: LogEntry[] = [];\n let isEnabled = false;\n\n return {\n enable: () => {\n isEnabled = true;\n },\n debug: (...args) => {\n if (isEnabled) {\n entries.push(args.map(arg => (typeof arg === 'function' ? arg() : arg)));\n }\n },\n commit: () => {\n if (isEnabled) {\n console.log(debugLogHeader(name));\n\n /**\n * We buffer each collected log entry so we can format them and log them all at once.\n * Individual console.log calls are used to ensure we don't hit platform-specific log limits (Vercel and Netlify are 4kb).\n */\n for (const log of entries) {\n let output = formatter(log);\n\n output = output\n .split('\\n')\n .map(l => ` ${l}`)\n .join('\\n');\n\n // Vercel errors if the output is > 4kb, so we truncate it\n if (process.env.VERCEL) {\n output = truncate(output, 4096);\n }\n\n console.log(output);\n }\n\n console.log(debugLogFooter(name));\n }\n },\n };\n};\n\ntype WithLogger = <L extends Logger, H extends (...args: any[]) => any>(\n loggerFactoryOrName: string | (() => L),\n handlerCtor: (logger: LoggerNoCommit<L>) => H,\n) => H;\n\nexport const withLogger: WithLogger = (loggerFactoryOrName, handlerCtor) => {\n return ((...args: any) => {\n const factory =\n typeof loggerFactoryOrName === 'string'\n ? createDebugLogger(loggerFactoryOrName, logFormatter)\n : loggerFactoryOrName;\n\n const logger = factory();\n const handler = handlerCtor(logger as any);\n\n try {\n const res = handler(...args);\n if (typeof res === 'object' && 'then' in res && typeof res.then === 'function') {\n return res\n .then((val: any) => {\n logger.commit();\n return val;\n })\n .catch((err: any) => {\n logger.commit();\n throw err;\n });\n }\n // handle sync methods\n logger.commit();\n return res;\n } catch (err: any) {\n logger.commit();\n throw err;\n }\n }) as ReturnType<typeof handlerCtor>;\n};\n\nfunction debugLogHeader(name: string) {\n return `[clerk debug start: ${name}]`;\n}\n\nfunction debugLogFooter(name: string) {\n return `[clerk debug end: ${name}] (@clerk/nextjs=${PACKAGE_VERSION},next=${nextPkg.version},timestamp=${Math.round(new Date().getTime() / 1_000)})`;\n}\n\n// ref: https://stackoverflow.com/questions/57769465/javascript-truncate-text-by-bytes-length\nfunction truncate(str: string, maxLength: number) {\n const encoder = new TextEncoder();\n const decoder = new TextDecoder('utf-8');\n\n const encodedString = encoder.encode(str);\n const truncatedString = encodedString.slice(0, maxLength);\n\n // return the truncated string, removing any replacement characters that result from partially truncated characters\n return decoder.decode(truncatedString).replace(/\\uFFFD/g, '');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qBAAoB;AAEpB,0BAA6B;AAWtB,MAAM,oBAAoB,CAAC,MAAc,cAAyC,MAAc;AACrG,QAAM,UAAsB,CAAC;AAC7B,MAAI,YAAY;AAEhB,SAAO;AAAA,IACL,QAAQ,MAAM;AACZ,kBAAY;AAAA,IACd;AAAA,IACA,OAAO,IAAI,SAAS;AAClB,UAAI,WAAW;AACb,gBAAQ,KAAK,KAAK,IAAI,SAAQ,OAAO,QAAQ,aAAa,IAAI,IAAI,GAAI,CAAC;AAAA,MACzE;AAAA,IACF;AAAA,IACA,QAAQ,MAAM;AACZ,UAAI,WAAW;AACb,gBAAQ,IAAI,eAAe,IAAI,CAAC;AAMhC,mBAAW,OAAO,SAAS;AACzB,cAAI,SAAS,UAAU,GAAG;AAE1B,mBAAS,OACN,MAAM,IAAI,EACV,IAAI,OAAK,KAAK,CAAC,EAAE,EACjB,KAAK,IAAI;AAGZ,cAAI,QAAQ,IAAI,QAAQ;AACtB,qBAAS,SAAS,QAAQ,IAAI;AAAA,UAChC;AAEA,kBAAQ,IAAI,MAAM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extRequest } from "next/server";
4
- const CLERK_USE_CACHE_MARKER = Symbol.for("clerk_use_cache_error");
4
+ const CLERK_USE_CACHE_MARKER = /* @__PURE__ */ Symbol.for("clerk_use_cache_error");
5
5
  class ClerkUseCacheError extends (_b = Error, _a = CLERK_USE_CACHE_MARKER, _b) {
6
6
  constructor(message, originalError) {
7
7
  super(message);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/app-router/server/utils.ts"],"sourcesContent":["import { NextRequest } from 'next/server';\n\nconst CLERK_USE_CACHE_MARKER = Symbol.for('clerk_use_cache_error');\n\n/**\n * Custom error class for \"use cache\" errors with a symbol marker to prevent double-wrapping.\n */\nexport class ClerkUseCacheError extends Error {\n readonly [CLERK_USE_CACHE_MARKER] = true;\n\n constructor(\n message: string,\n public readonly originalError?: Error,\n ) {\n super(message);\n this.name = 'ClerkUseCacheError';\n }\n}\n\nexport const isClerkUseCacheError = (e: unknown): e is ClerkUseCacheError => {\n return e instanceof Error && CLERK_USE_CACHE_MARKER in e;\n};\n\n// Patterns for Next.js \"use cache\" errors - tightened to reduce false positives\n// Matches both \"use cache\" (double quotes) and 'use cache' (single quotes)\nconst USE_CACHE_WITH_DYNAMIC_API_PATTERN =\n /inside\\s+[\"']use cache[\"']|[\"']use cache[\"'].*(?:headers|cookies)|(?:headers|cookies).*[\"']use cache[\"']/i;\nconst CACHE_SCOPE_PATTERN = /cache scope/i;\nconst DYNAMIC_DATA_SOURCE_PATTERN = /dynamic data source/i;\n// https://github.com/vercel/next.js/pull/61332\nconst ROUTE_BAILOUT_PATTERN = /Route .*? needs to bail out of prerendering at this point because it used .*?./;\n\nexport const isPrerenderingBailout = (e: unknown) => {\n if (!(e instanceof Error) || !('message' in e)) {\n return false;\n }\n\n const { message } = e;\n const lowerCaseInput = message.toLowerCase();\n\n return (\n ROUTE_BAILOUT_PATTERN.test(message) ||\n lowerCaseInput.includes('dynamic server usage') ||\n lowerCaseInput.includes('this page needs to bail out of prerendering') ||\n lowerCaseInput.includes('during prerendering')\n );\n};\n\n/**\n * Detects Next.js errors from using dynamic APIs (headers/cookies) inside \"use cache\".\n */\nexport const isNextjsUseCacheError = (e: unknown): boolean => {\n if (!(e instanceof Error)) {\n return false;\n }\n\n const { message } = e;\n\n // \"use cache\" with dynamic API context (e.g., 'used `headers()` inside \"use cache\"')\n if (USE_CACHE_WITH_DYNAMIC_API_PATTERN.test(message)) {\n return true;\n }\n\n // \"cache scope\" with dynamic data source (e.g., 'Dynamic data sources inside a cache scope')\n if (CACHE_SCOPE_PATTERN.test(message) && DYNAMIC_DATA_SOURCE_PATTERN.test(message)) {\n return true;\n }\n\n return false;\n};\n\nexport const USE_CACHE_ERROR_MESSAGE =\n `Clerk: auth() and currentUser() cannot be called inside a \"use cache\" function. ` +\n `These functions access \\`headers()\\` internally, which is a dynamic API not allowed in cached contexts.\\n\\n` +\n `To fix this, call auth() outside the cached function and pass the values you need as arguments:\\n\\n` +\n ` import { auth, clerkClient } from '@clerk/nextjs/server';\\n\\n` +\n ` async function getCachedUser(userId: string) {\\n` +\n ` \"use cache\";\\n` +\n ` const client = await clerkClient();\\n` +\n ` return client.users.getUser(userId);\\n` +\n ` }\\n\\n` +\n ` // In your component/page:\\n` +\n ` const { userId } = await auth();\\n` +\n ` if (userId) {\\n` +\n ` const user = await getCachedUser(userId);\\n` +\n ` }`;\n\nexport async function buildRequestLike(): Promise<NextRequest> {\n try {\n // @ts-expect-error - Dynamically import to avoid breaking Next 12 apps\n const { headers } = await import('next/headers');\n const resolvedHeaders = await headers();\n return new NextRequest('https://placeholder.com', { headers: resolvedHeaders });\n } catch (e: any) {\n // https://nextjs.org/docs/messages/ppr-caught-error\n if (e && isPrerenderingBailout(e)) {\n throw e;\n }\n\n if (e && isNextjsUseCacheError(e)) {\n throw new ClerkUseCacheError(`${USE_CACHE_ERROR_MESSAGE}\\n\\nOriginal error: ${e.message}`, e);\n }\n\n throw new Error(\n `Clerk: auth(), currentUser() and clerkClient(), are only supported in App Router (/app directory).\\nIf you're using /pages, try getAuth() instead.\\nOriginal error: ${e}`,\n );\n }\n}\n\n// Original source: https://github.com/vercel/next.js/blob/canary/packages/next/src/server/app-render/get-script-nonce-from-header.tsx\nexport function getScriptNonceFromHeader(cspHeaderValue: string): string | undefined {\n const directives = cspHeaderValue\n // Directives are split by ';'.\n .split(';')\n .map(directive => directive.trim());\n\n // First try to find the directive for the 'script-src', otherwise try to\n // fallback to the 'default-src'.\n const directive =\n directives.find(dir => dir.startsWith('script-src')) || directives.find(dir => dir.startsWith('default-src'));\n\n // If no directive could be found, then we're done.\n if (!directive) {\n return;\n }\n\n // Extract the nonce from the directive\n const nonce = directive\n .split(' ')\n // Remove the 'strict-src'/'default-src' string, this can't be the nonce.\n .slice(1)\n .map(source => source.trim())\n // Find the first source with the 'nonce-' prefix.\n .find(source => source.startsWith(\"'nonce-\") && source.length > 8 && source.endsWith(\"'\"))\n // Grab the nonce by trimming the 'nonce-' prefix.\n ?.slice(7, -1);\n\n // If we couldn't find the nonce, then we're done.\n if (!nonce) {\n return;\n }\n\n // Don't accept the nonce value if it contains HTML escape characters.\n // Technically, the spec requires a base64'd value, but this is just an\n // extra layer.\n if (/[&><\\u2028\\u2029]/g.test(nonce)) {\n throw new Error(\n 'Nonce value from Content-Security-Policy contained invalid HTML escape characters, which is disallowed for security reasons. Make sure that your nonce value does not contain the following characters: `<`, `>`, `&`',\n );\n }\n\n return nonce;\n}\n"],"mappings":";AAAA;AAAA,SAAS,mBAAmB;AAE5B,MAAM,yBAAyB,OAAO,IAAI,uBAAuB;AAK1D,MAAM,4BAA2B,YAC5B,6BAD4B,IAAM;AAAA,EAG5C,YACE,SACgB,eAChB;AACA,UAAM,OAAO;AAFG;AAJlB,SAAU,MAA0B;AAOlC,SAAK,OAAO;AAAA,EACd;AACF;AAEO,MAAM,uBAAuB,CAAC,MAAwC;AAC3E,SAAO,aAAa,SAAS,0BAA0B;AACzD;AAIA,MAAM,qCACJ;AACF,MAAM,sBAAsB;AAC5B,MAAM,8BAA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;AA9GrF,MAAAA;AA+GE,QAAM,aAAa,eAEhB,MAAM,GAAG,EACT,IAAI,CAAAC,eAAaA,WAAU,KAAK,CAAC;AAIpC,QAAM,YACJ,WAAW,KAAK,SAAO,IAAI,WAAW,YAAY,CAAC,KAAK,WAAW,KAAK,SAAO,IAAI,WAAW,aAAa,CAAC;AAG9G,MAAI,CAAC,WAAW;AACd;AAAA,EACF;AAGA,QAAM,SAAQD,MAAA,UACX,MAAM,GAAG,EAET,MAAM,CAAC,EACP,IAAI,YAAU,OAAO,KAAK,CAAC,EAE3B,KAAK,YAAU,OAAO,WAAW,SAAS,KAAK,OAAO,SAAS,KAAK,OAAO,SAAS,GAAG,CAAC,MAN7E,gBAAAA,IAQV,MAAM,GAAG;AAGb,MAAI,CAAC,OAAO;AACV;AAAA,EACF;AAKA,MAAI,qBAAqB,KAAK,KAAK,GAAG;AACpC,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;","names":["_a","directive"]}
1
+ {"version":3,"sources":["../../../../src/app-router/server/utils.ts"],"sourcesContent":["import { NextRequest } from 'next/server';\n\nconst CLERK_USE_CACHE_MARKER = Symbol.for('clerk_use_cache_error');\n\n/**\n * Custom error class for \"use cache\" errors with a symbol marker to prevent double-wrapping.\n */\nexport class ClerkUseCacheError extends Error {\n readonly [CLERK_USE_CACHE_MARKER] = true;\n\n constructor(\n message: string,\n public readonly originalError?: Error,\n ) {\n super(message);\n this.name = 'ClerkUseCacheError';\n }\n}\n\nexport const isClerkUseCacheError = (e: unknown): e is ClerkUseCacheError => {\n return e instanceof Error && CLERK_USE_CACHE_MARKER in e;\n};\n\n// Patterns for Next.js \"use cache\" errors - tightened to reduce false positives\n// Matches both \"use cache\" (double quotes) and 'use cache' (single quotes)\nconst USE_CACHE_WITH_DYNAMIC_API_PATTERN =\n /inside\\s+[\"']use cache[\"']|[\"']use cache[\"'].*(?:headers|cookies)|(?:headers|cookies).*[\"']use cache[\"']/i;\nconst CACHE_SCOPE_PATTERN = /cache scope/i;\nconst DYNAMIC_DATA_SOURCE_PATTERN = /dynamic data source/i;\n// https://github.com/vercel/next.js/pull/61332\nconst ROUTE_BAILOUT_PATTERN = /Route .*? needs to bail out of prerendering at this point because it used .*?./;\n\nexport const isPrerenderingBailout = (e: unknown) => {\n if (!(e instanceof Error) || !('message' in e)) {\n return false;\n }\n\n const { message } = e;\n const lowerCaseInput = message.toLowerCase();\n\n return (\n ROUTE_BAILOUT_PATTERN.test(message) ||\n lowerCaseInput.includes('dynamic server usage') ||\n lowerCaseInput.includes('this page needs to bail out of prerendering') ||\n lowerCaseInput.includes('during prerendering')\n );\n};\n\n/**\n * Detects Next.js errors from using dynamic APIs (headers/cookies) inside \"use cache\".\n */\nexport const isNextjsUseCacheError = (e: unknown): boolean => {\n if (!(e instanceof Error)) {\n return false;\n }\n\n const { message } = e;\n\n // \"use cache\" with dynamic API context (e.g., 'used `headers()` inside \"use cache\"')\n if (USE_CACHE_WITH_DYNAMIC_API_PATTERN.test(message)) {\n return true;\n }\n\n // \"cache scope\" with dynamic data source (e.g., 'Dynamic data sources inside a cache scope')\n if (CACHE_SCOPE_PATTERN.test(message) && DYNAMIC_DATA_SOURCE_PATTERN.test(message)) {\n return true;\n }\n\n return false;\n};\n\nexport const USE_CACHE_ERROR_MESSAGE =\n `Clerk: auth() and currentUser() cannot be called inside a \"use cache\" function. ` +\n `These functions access \\`headers()\\` internally, which is a dynamic API not allowed in cached contexts.\\n\\n` +\n `To fix this, call auth() outside the cached function and pass the values you need as arguments:\\n\\n` +\n ` import { auth, clerkClient } from '@clerk/nextjs/server';\\n\\n` +\n ` async function getCachedUser(userId: string) {\\n` +\n ` \"use cache\";\\n` +\n ` const client = await clerkClient();\\n` +\n ` return client.users.getUser(userId);\\n` +\n ` }\\n\\n` +\n ` // In your component/page:\\n` +\n ` const { userId } = await auth();\\n` +\n ` if (userId) {\\n` +\n ` const user = await getCachedUser(userId);\\n` +\n ` }`;\n\nexport async function buildRequestLike(): Promise<NextRequest> {\n try {\n // @ts-expect-error - Dynamically import to avoid breaking Next 12 apps\n const { headers } = await import('next/headers');\n const resolvedHeaders = await headers();\n return new NextRequest('https://placeholder.com', { headers: resolvedHeaders });\n } catch (e: any) {\n // https://nextjs.org/docs/messages/ppr-caught-error\n if (e && isPrerenderingBailout(e)) {\n throw e;\n }\n\n if (e && isNextjsUseCacheError(e)) {\n throw new ClerkUseCacheError(`${USE_CACHE_ERROR_MESSAGE}\\n\\nOriginal error: ${e.message}`, e);\n }\n\n throw new Error(\n `Clerk: auth(), currentUser() and clerkClient(), are only supported in App Router (/app directory).\\nIf you're using /pages, try getAuth() instead.\\nOriginal error: ${e}`,\n );\n }\n}\n\n// Original source: https://github.com/vercel/next.js/blob/canary/packages/next/src/server/app-render/get-script-nonce-from-header.tsx\nexport function getScriptNonceFromHeader(cspHeaderValue: string): string | undefined {\n const directives = cspHeaderValue\n // Directives are split by ';'.\n .split(';')\n .map(directive => directive.trim());\n\n // First try to find the directive for the 'script-src', otherwise try to\n // fallback to the 'default-src'.\n const directive =\n directives.find(dir => dir.startsWith('script-src')) || directives.find(dir => dir.startsWith('default-src'));\n\n // If no directive could be found, then we're done.\n if (!directive) {\n return;\n }\n\n // Extract the nonce from the directive\n const nonce = directive\n .split(' ')\n // Remove the 'strict-src'/'default-src' string, this can't be the nonce.\n .slice(1)\n .map(source => source.trim())\n // Find the first source with the 'nonce-' prefix.\n .find(source => source.startsWith(\"'nonce-\") && source.length > 8 && source.endsWith(\"'\"))\n // Grab the nonce by trimming the 'nonce-' prefix.\n ?.slice(7, -1);\n\n // If we couldn't find the nonce, then we're done.\n if (!nonce) {\n return;\n }\n\n // Don't accept the nonce value if it contains HTML escape characters.\n // Technically, the spec requires a base64'd value, but this is just an\n // extra layer.\n if (/[&><\\u2028\\u2029]/g.test(nonce)) {\n throw new Error(\n 'Nonce value from Content-Security-Policy contained invalid HTML escape characters, which is disallowed for security reasons. Make sure that your nonce value does not contain the following characters: `<`, `>`,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,WAAO,IAAI,YAAY,2BAA2B,EAAE,SAAS,gBAAgB,CAAC;AAAA,EAChF,SAAS,GAAQ;AAEf,QAAI,KAAK,sBAAsB,CAAC,GAAG;AACjC,YAAM;AAAA,IACR;AAEA,QAAI,KAAK,sBAAsB,CAAC,GAAG;AACjC,YAAM,IAAI,mBAAmB,GAAG,uBAAuB;AAAA;AAAA,kBAAuB,EAAE,OAAO,IAAI,CAAC;AAAA,IAC9F;AAEA,UAAM,IAAI;AAAA,MACR;AAAA;AAAA,kBAAuK,CAAC;AAAA,IAC1K;AAAA,EACF;AACF;AAGO,SAAS,yBAAyB,gBAA4C;AA9GrF,MAAAA;AA+GE,QAAM,aAAa,eAEhB,MAAM,GAAG,EACT,IAAI,CAAAC,eAAaA,WAAU,KAAK,CAAC;AAIpC,QAAM,YACJ,WAAW,KAAK,SAAO,IAAI,WAAW,YAAY,CAAC,KAAK,WAAW,KAAK,SAAO,IAAI,WAAW,aAAa,CAAC;AAG9G,MAAI,CAAC,WAAW;AACd;AAAA,EACF;AAGA,QAAM,SAAQD,MAAA,UACX,MAAM,GAAG,EAET,MAAM,CAAC,EACP,IAAI,YAAU,OAAO,KAAK,CAAC,EAE3B,KAAK,YAAU,OAAO,WAAW,SAAS,KAAK,OAAO,SAAS,KAAK,OAAO,SAAS,GAAG,CAAC,MAN7E,gBAAAA,IAQV,MAAM,GAAG;AAGb,MAAI,CAAC,OAAO;AACV;AAAA,EACF;AAKA,MAAI,qBAAqB,KAAK,KAAK,GAAG;AACpC,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;","names":["_a","directive"]}
@@ -27,7 +27,6 @@ import {
27
27
  Waitlist,
28
28
  HandleSSOCallback
29
29
  } from "@clerk/react";
30
- import { OAuthConsent } from "@clerk/react/internal";
31
30
  const UserProfile = Object.assign(
32
31
  (props) => {
33
32
  return /* @__PURE__ */ React.createElement(BaseUserProfile, { ...useEnforceCorrectRoutingProps("UserProfile", props) });
@@ -51,7 +50,6 @@ export {
51
50
  CreateOrganization,
52
51
  GoogleOneTap,
53
52
  HandleSSOCallback,
54
- OAuthConsent,
55
53
  OrganizationList,
56
54
  OrganizationProfile,
57
55
  OrganizationSwitcher,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/client-boundary/uiComponents.tsx"],"sourcesContent":["'use client';\n\nimport {\n OrganizationProfile as BaseOrganizationProfile,\n SignIn as BaseSignIn,\n SignUp as BaseSignUp,\n UserProfile as BaseUserProfile,\n} from '@clerk/react';\nimport type { ComponentProps } from 'react';\nimport React from 'react';\n\nimport { useEnforceCorrectRoutingProps } from './hooks/useEnforceRoutingProps';\n\nexport {\n APIKeys,\n CreateOrganization,\n GoogleOneTap,\n OrganizationList,\n OrganizationSwitcher,\n PricingTable,\n SignInButton,\n SignInWithMetamaskButton,\n SignOutButton,\n SignUpButton,\n TaskChooseOrganization,\n TaskResetPassword,\n TaskSetupMFA,\n UserAvatar,\n UserButton,\n Waitlist,\n HandleSSOCallback,\n} from '@clerk/react';\n\nexport { OAuthConsent } from '@clerk/react/internal';\n\n// The assignment of UserProfile with BaseUserProfile props is used\n// to support the CustomPage functionality (eg UserProfile.Page)\n// Also the `typeof BaseUserProfile` is used to resolve the following error:\n// \"The inferred type of 'UserProfile' cannot be named without a reference to ...\"\nexport const UserProfile: typeof BaseUserProfile = Object.assign(\n (props: ComponentProps<typeof BaseUserProfile>) => {\n return <BaseUserProfile {...useEnforceCorrectRoutingProps('UserProfile', props)} />;\n },\n { ...BaseUserProfile },\n);\n\n// The assignment of OrganizationProfile with BaseOrganizationProfile props is used\n// to support the CustomPage functionality (eg OrganizationProfile.Page)\n// Also the `typeof BaseOrganizationProfile` is used to resolved the following error:\n// \"The inferred type of 'OrganizationProfile' cannot be named without a reference to ...\"\nexport const OrganizationProfile: typeof BaseOrganizationProfile = Object.assign(\n (props: ComponentProps<typeof BaseOrganizationProfile>) => {\n return <BaseOrganizationProfile {...useEnforceCorrectRoutingProps('OrganizationProfile', props)} />;\n },\n { ...BaseOrganizationProfile },\n);\n\nexport const SignIn = (props: ComponentProps<typeof BaseSignIn>) => {\n return <BaseSignIn {...useEnforceCorrectRoutingProps('SignIn', props, false)} />;\n};\n\nexport const SignUp = (props: ComponentProps<typeof BaseSignUp>) => {\n return <BaseSignUp {...useEnforceCorrectRoutingProps('SignUp', props, false)} />;\n};\n"],"mappings":";;AAEA;AAAA,EACE,uBAAuB;AAAA,EACvB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,eAAe;AAAA,OACV;AAEP,OAAO,WAAW;AAElB,SAAS,qCAAqC;AAE9C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,oBAAoB;AAMtB,MAAM,cAAsC,OAAO;AAAA,EACxD,CAAC,UAAkD;AACjD,WAAO,oCAAC,mBAAiB,GAAG,8BAA8B,eAAe,KAAK,GAAG;AAAA,EACnF;AAAA,EACA,EAAE,GAAG,gBAAgB;AACvB;AAMO,MAAM,sBAAsD,OAAO;AAAA,EACxE,CAAC,UAA0D;AACzD,WAAO,oCAAC,2BAAyB,GAAG,8BAA8B,uBAAuB,KAAK,GAAG;AAAA,EACnG;AAAA,EACA,EAAE,GAAG,wBAAwB;AAC/B;AAEO,MAAM,SAAS,CAAC,UAA6C;AAClE,SAAO,oCAAC,cAAY,GAAG,8BAA8B,UAAU,OAAO,KAAK,GAAG;AAChF;AAEO,MAAM,SAAS,CAAC,UAA6C;AAClE,SAAO,oCAAC,cAAY,GAAG,8BAA8B,UAAU,OAAO,KAAK,GAAG;AAChF;","names":[]}
1
+ {"version":3,"sources":["../../../src/client-boundary/uiComponents.tsx"],"sourcesContent":["'use client';\n\nimport {\n OrganizationProfile as BaseOrganizationProfile,\n SignIn as BaseSignIn,\n SignUp as BaseSignUp,\n UserProfile as BaseUserProfile,\n} from '@clerk/react';\nimport type { ComponentProps } from 'react';\nimport React from 'react';\n\nimport { useEnforceCorrectRoutingProps } from './hooks/useEnforceRoutingProps';\n\nexport {\n APIKeys,\n CreateOrganization,\n GoogleOneTap,\n OrganizationList,\n OrganizationSwitcher,\n PricingTable,\n SignInButton,\n SignInWithMetamaskButton,\n SignOutButton,\n SignUpButton,\n TaskChooseOrganization,\n TaskResetPassword,\n TaskSetupMFA,\n UserAvatar,\n UserButton,\n Waitlist,\n HandleSSOCallback,\n} from '@clerk/react';\n\n// The assignment of UserProfile with BaseUserProfile props is used\n// to support the CustomPage functionality (eg UserProfile.Page)\n// Also the `typeof BaseUserProfile` is used to resolve the following error:\n// \"The inferred type of 'UserProfile' cannot be named without a reference to ...\"\nexport const UserProfile: typeof BaseUserProfile = Object.assign(\n (props: ComponentProps<typeof BaseUserProfile>) => {\n return <BaseUserProfile {...useEnforceCorrectRoutingProps('UserProfile', props)} />;\n },\n { ...BaseUserProfile },\n);\n\n// The assignment of OrganizationProfile with BaseOrganizationProfile props is used\n// to support the CustomPage functionality (eg OrganizationProfile.Page)\n// Also the `typeof BaseOrganizationProfile` is used to resolved the following error:\n// \"The inferred type of 'OrganizationProfile' cannot be named without a reference to ...\"\nexport const OrganizationProfile: typeof BaseOrganizationProfile = Object.assign(\n (props: ComponentProps<typeof BaseOrganizationProfile>) => {\n return <BaseOrganizationProfile {...useEnforceCorrectRoutingProps('OrganizationProfile', props)} />;\n },\n { ...BaseOrganizationProfile },\n);\n\nexport const SignIn = (props: ComponentProps<typeof BaseSignIn>) => {\n return <BaseSignIn {...useEnforceCorrectRoutingProps('SignIn', props, false)} />;\n};\n\nexport const SignUp = (props: ComponentProps<typeof BaseSignUp>) => {\n return <BaseSignUp {...useEnforceCorrectRoutingProps('SignUp', props, false)} />;\n};\n"],"mappings":";;AAEA;AAAA,EACE,uBAAuB;AAAA,EACvB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,eAAe;AAAA,OACV;AAEP,OAAO,WAAW;AAElB,SAAS,qCAAqC;AAE9C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAMA,MAAM,cAAsC,OAAO;AAAA,EACxD,CAAC,UAAkD;AACjD,WAAO,oCAAC,mBAAiB,GAAG,8BAA8B,eAAe,KAAK,GAAG;AAAA,EACnF;AAAA,EACA,EAAE,GAAG,gBAAgB;AACvB;AAMO,MAAM,sBAAsD,OAAO;AAAA,EACxE,CAAC,UAA0D;AACzD,WAAO,oCAAC,2BAAyB,GAAG,8BAA8B,uBAAuB,KAAK,GAAG;AAAA,EACnG;AAAA,EACA,EAAE,GAAG,wBAAwB;AAC/B;AAEO,MAAM,SAAS,CAAC,UAA6C;AAClE,SAAO,oCAAC,cAAY,GAAG,8BAA8B,UAAU,OAAO,KAAK,GAAG;AAChF;AAEO,MAAM,SAAS,CAAC,UAA6C;AAClE,SAAO,oCAAC,cAAY,GAAG,8BAA8B,UAAU,OAAO,KAAK,GAAG;AAChF;","names":[]}
@@ -1,10 +1,8 @@
1
1
  import "./chunk-BUSYA2B4.js";
2
2
  import { MultisessionAppSupport } from "./client-boundary/controlComponents";
3
- import { OAuthConsent } from "./client-boundary/uiComponents";
4
3
  import { useOAuthConsent } from "@clerk/shared/react";
5
4
  export {
6
5
  MultisessionAppSupport,
7
- OAuthConsent,
8
6
  useOAuthConsent
9
7
  };
10
8
  //# sourceMappingURL=internal.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/internal.ts"],"sourcesContent":["/**\n * These need to be explicitly listed. Do not use an * here.\n * If you do, app router will break.\n */\nexport { MultisessionAppSupport } from './client-boundary/controlComponents';\nexport { OAuthConsent } from './client-boundary/uiComponents';\nexport { useOAuthConsent } from '@clerk/shared/react';\n"],"mappings":";AAIA,SAAS,8BAA8B;AACvC,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;","names":[]}
1
+ {"version":3,"sources":["../../src/internal.ts"],"sourcesContent":["/**\n * These need to be explicitly listed. Do not use an * here.\n * If you do, app router will break.\n */\nexport { MultisessionAppSupport } from './client-boundary/controlComponents';\nexport { useOAuthConsent } from '@clerk/shared/react';\n"],"mappings":";AAIA,SAAS,8BAA8B;AACvC,SAAS,uBAAuB;","names":[]}
@@ -18,7 +18,7 @@ const SIGN_IN_URL = process.env.NEXT_PUBLIC_CLERK_SIGN_IN_URL || "";
18
18
  const SIGN_UP_URL = process.env.NEXT_PUBLIC_CLERK_SIGN_UP_URL || "";
19
19
  const SDK_METADATA = {
20
20
  name: "@clerk/nextjs",
21
- version: "7.1.0-snapshot.v20260413174426",
21
+ version: "7.1.0",
22
22
  environment: process.env.NODE_ENV
23
23
  };
24
24
  const TELEMETRY_DISABLED = isTruthy(process.env.NEXT_PUBLIC_CLERK_TELEMETRY_DISABLED);
@@ -18,7 +18,7 @@ const clerkClientDefaultOptions = {
18
18
  publishableKey: PUBLISHABLE_KEY,
19
19
  apiUrl: API_URL,
20
20
  apiVersion: API_VERSION,
21
- userAgent: `${"@clerk/nextjs"}@${"7.1.0-snapshot.v20260413174426"}`,
21
+ userAgent: `${"@clerk/nextjs"}@${"7.1.0"}`,
22
22
  proxyUrl: PROXY_URL,
23
23
  domain: DOMAIN,
24
24
  isSatellite: IS_SATELLITE,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/server/createClerkClient.ts"],"sourcesContent":["import { createClerkClient } from '@clerk/backend';\n\nimport {\n API_URL,\n API_VERSION,\n DOMAIN,\n IS_SATELLITE,\n MACHINE_SECRET_KEY,\n PROXY_URL,\n PUBLISHABLE_KEY,\n SDK_METADATA,\n SECRET_KEY,\n TELEMETRY_DEBUG,\n TELEMETRY_DISABLED,\n} from './constants';\n\nconst clerkClientDefaultOptions = {\n secretKey: SECRET_KEY,\n publishableKey: PUBLISHABLE_KEY,\n apiUrl: API_URL,\n apiVersion: API_VERSION,\n userAgent: `${PACKAGE_NAME}@${PACKAGE_VERSION}`,\n proxyUrl: PROXY_URL,\n domain: DOMAIN,\n isSatellite: IS_SATELLITE,\n machineSecretKey: MACHINE_SECRET_KEY,\n sdkMetadata: SDK_METADATA,\n telemetry: {\n disabled: TELEMETRY_DISABLED,\n debug: TELEMETRY_DEBUG,\n },\n};\n\nexport const createClerkClientWithOptions: typeof createClerkClient = options =>\n createClerkClient({ ...clerkClientDefaultOptions, ...options });\n"],"mappings":";AAAA,SAAS,yBAAyB;AAElC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,MAAM,4BAA4B;AAAA,EAChC,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,WAAW,GAAG,eAAY,IAAI,gCAAe;AAAA,EAC7C,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,WAAW;AAAA,IACT,UAAU;AAAA,IACV,OAAO;AAAA,EACT;AACF;AAEO,MAAM,+BAAyD,aACpE,kBAAkB,EAAE,GAAG,2BAA2B,GAAG,QAAQ,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../../src/server/createClerkClient.ts"],"sourcesContent":["import { createClerkClient } from '@clerk/backend';\n\nimport {\n API_URL,\n API_VERSION,\n DOMAIN,\n IS_SATELLITE,\n MACHINE_SECRET_KEY,\n PROXY_URL,\n PUBLISHABLE_KEY,\n SDK_METADATA,\n SECRET_KEY,\n TELEMETRY_DEBUG,\n TELEMETRY_DISABLED,\n} from './constants';\n\nconst clerkClientDefaultOptions = {\n secretKey: SECRET_KEY,\n publishableKey: PUBLISHABLE_KEY,\n apiUrl: API_URL,\n apiVersion: API_VERSION,\n userAgent: `${PACKAGE_NAME}@${PACKAGE_VERSION}`,\n proxyUrl: PROXY_URL,\n domain: DOMAIN,\n isSatellite: IS_SATELLITE,\n machineSecretKey: MACHINE_SECRET_KEY,\n sdkMetadata: SDK_METADATA,\n telemetry: {\n disabled: TELEMETRY_DISABLED,\n debug: TELEMETRY_DEBUG,\n },\n};\n\nexport const createClerkClientWithOptions: typeof createClerkClient = options =>\n createClerkClient({ ...clerkClientDefaultOptions, ...options });\n"],"mappings":";AAAA,SAAS,yBAAyB;AAElC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,MAAM,4BAA4B;AAAA,EAChC,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,WAAW,GAAG,eAAY,IAAI,OAAe;AAAA,EAC7C,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,WAAW;AAAA,IACT,UAAU;AAAA,IACV,OAAO;AAAA,EACT;AACF;AAEO,MAAM,+BAAyD,aACpE,kBAAkB,EAAE,GAAG,2BAA2B,GAAG,QAAQ,CAAC;","names":[]}
@@ -57,7 +57,7 @@ function debugLogHeader(name) {
57
57
  return `[clerk debug start: ${name}]`;
58
58
  }
59
59
  function debugLogFooter(name) {
60
- return `[clerk debug end: ${name}] (@clerk/nextjs=${"7.1.0-snapshot.v20260413174426"},next=${nextPkg.version},timestamp=${Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3)})`;
60
+ return `[clerk debug end: ${name}] (@clerk/nextjs=${"7.1.0"},next=${nextPkg.version},timestamp=${Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3)})`;
61
61
  }
62
62
  function truncate(str, maxLength) {
63
63
  const encoder = new TextEncoder();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/debugLogger.ts"],"sourcesContent":["// TODO: Replace with a more sophisticated logging solution\n\nimport nextPkg from 'next/package.json';\n\nimport { logFormatter } from './logFormatter';\n\nexport type Log = string | Record<string, unknown>;\nexport type LogEntry = Log | Log[];\nexport type Logger<L = Log> = {\n commit: () => void;\n debug: (...args: Array<L | (() => L)>) => void;\n enable: () => void;\n};\nexport type LoggerNoCommit<L = Logger> = Omit<L, 'commit'>;\n\nexport const createDebugLogger = (name: string, formatter: (val: LogEntry) => string) => (): Logger => {\n const entries: LogEntry[] = [];\n let isEnabled = false;\n\n return {\n enable: () => {\n isEnabled = true;\n },\n debug: (...args) => {\n if (isEnabled) {\n entries.push(args.map(arg => (typeof arg === 'function' ? arg() : arg)));\n }\n },\n commit: () => {\n if (isEnabled) {\n console.log(debugLogHeader(name));\n\n /**\n * We buffer each collected log entry so we can format them and log them all at once.\n * Individual console.log calls are used to ensure we don't hit platform-specific log limits (Vercel and Netlify are 4kb).\n */\n for (const log of entries) {\n let output = formatter(log);\n\n output = output\n .split('\\n')\n .map(l => ` ${l}`)\n .join('\\n');\n\n // Vercel errors if the output is > 4kb, so we truncate it\n if (process.env.VERCEL) {\n output = truncate(output, 4096);\n }\n\n console.log(output);\n }\n\n console.log(debugLogFooter(name));\n }\n },\n };\n};\n\ntype WithLogger = <L extends Logger, H extends (...args: any[]) => any>(\n loggerFactoryOrName: string | (() => L),\n handlerCtor: (logger: LoggerNoCommit<L>) => H,\n) => H;\n\nexport const withLogger: WithLogger = (loggerFactoryOrName, handlerCtor) => {\n return ((...args: any) => {\n const factory =\n typeof loggerFactoryOrName === 'string'\n ? createDebugLogger(loggerFactoryOrName, logFormatter)\n : loggerFactoryOrName;\n\n const logger = factory();\n const handler = handlerCtor(logger as any);\n\n try {\n const res = handler(...args);\n if (typeof res === 'object' && 'then' in res && typeof res.then === 'function') {\n return res\n .then((val: any) => {\n logger.commit();\n return val;\n })\n .catch((err: any) => {\n logger.commit();\n throw err;\n });\n }\n // handle sync methods\n logger.commit();\n return res;\n } catch (err: any) {\n logger.commit();\n throw err;\n }\n }) as ReturnType<typeof handlerCtor>;\n};\n\nfunction debugLogHeader(name: string) {\n return `[clerk debug start: ${name}]`;\n}\n\nfunction debugLogFooter(name: string) {\n return `[clerk debug end: ${name}] (@clerk/nextjs=${PACKAGE_VERSION},next=${nextPkg.version},timestamp=${Math.round(new Date().getTime() / 1_000)})`;\n}\n\n// ref: https://stackoverflow.com/questions/57769465/javascript-truncate-text-by-bytes-length\nfunction truncate(str: string, maxLength: number) {\n const encoder = new TextEncoder();\n const decoder = new TextDecoder('utf-8');\n\n const encodedString = encoder.encode(str);\n const truncatedString = encodedString.slice(0, maxLength);\n\n // return the truncated string, removing any replacement characters that result from partially truncated characters\n return decoder.decode(truncatedString).replace(/\\uFFFD/g, '');\n}\n"],"mappings":";AAEA,OAAO,aAAa;AAEpB,SAAS,oBAAoB;AAWtB,MAAM,oBAAoB,CAAC,MAAc,cAAyC,MAAc;AACrG,QAAM,UAAsB,CAAC;AAC7B,MAAI,YAAY;AAEhB,SAAO;AAAA,IACL,QAAQ,MAAM;AACZ,kBAAY;AAAA,IACd;AAAA,IACA,OAAO,IAAI,SAAS;AAClB,UAAI,WAAW;AACb,gBAAQ,KAAK,KAAK,IAAI,SAAQ,OAAO,QAAQ,aAAa,IAAI,IAAI,GAAI,CAAC;AAAA,MACzE;AAAA,IACF;AAAA,IACA,QAAQ,MAAM;AACZ,UAAI,WAAW;AACb,gBAAQ,IAAI,eAAe,IAAI,CAAC;AAMhC,mBAAW,OAAO,SAAS;AACzB,cAAI,SAAS,UAAU,GAAG;AAE1B,mBAAS,OACN,MAAM,IAAI,EACV,IAAI,OAAK,KAAK,CAAC,EAAE,EACjB,KAAK,IAAI;AAGZ,cAAI,QAAQ,IAAI,QAAQ;AACtB,qBAAS,SAAS,QAAQ,IAAI;AAAA,UAChC;AAEA,k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ging solution\n\nimport nextPkg from 'next/package.json';\n\nimport { logFormatter } from './logFormatter';\n\nexport type Log = string | Record<string, unknown>;\nexport type LogEntry = Log | Log[];\nexport type Logger<L = Log> = {\n commit: () => void;\n debug: (...args: Array<L | (() => L)>) => void;\n enable: () => void;\n};\nexport type LoggerNoCommit<L = Logger> = Omit<L, 'commit'>;\n\nexport const createDebugLogger = (name: string, formatter: (val: LogEntry) => string) => (): Logger => {\n const entries: LogEntry[] = [];\n let isEnabled = false;\n\n return {\n enable: () => {\n isEnabled = true;\n },\n debug: (...args) => {\n if (isEnabled) {\n entries.push(args.map(arg => (typeof arg === 'function' ? arg() : arg)));\n }\n },\n commit: () => {\n if (isEnabled) {\n console.log(debugLogHeader(name));\n\n /**\n * We buffer each collected log entry so we can format them and log them all at once.\n * Individual console.log calls are used to ensure we don't hit platform-specific log limits (Vercel and Netlify are 4kb).\n */\n for (const log of entries) {\n let output = formatter(log);\n\n output = output\n .split('\\n')\n .map(l => ` ${l}`)\n .join('\\n');\n\n // Vercel errors if the output is > 4kb, so we truncate it\n if (process.env.VERCEL) {\n output = truncate(output, 4096);\n }\n\n console.log(output);\n }\n\n console.log(debugLogFooter(name));\n }\n },\n };\n};\n\ntype WithLogger = <L extends Logger, H extends (...args: any[]) => any>(\n loggerFactoryOrName: string | (() => L),\n handlerCtor: (logger: LoggerNoCommit<L>) => H,\n) => H;\n\nexport const withLogger: WithLogger = (loggerFactoryOrName, handlerCtor) => {\n return ((...args: any) => {\n const factory =\n typeof loggerFactoryOrName === 'string'\n ? createDebugLogger(loggerFactoryOrName, logFormatter)\n : loggerFactoryOrName;\n\n const logger = factory();\n const handler = handlerCtor(logger as any);\n\n try {\n const res = handler(...args);\n if (typeof res === 'object' && 'then' in res && typeof res.then === 'function') {\n return res\n .then((val: any) => {\n logger.commit();\n return val;\n })\n .catch((err: any) => {\n logger.commit();\n throw err;\n });\n }\n // handle sync methods\n logger.commit();\n return res;\n } catch (err: any) {\n logger.commit();\n throw err;\n }\n }) as ReturnType<typeof handlerCtor>;\n};\n\nfunction debugLogHeader(name: string) {\n return `[clerk debug start: ${name}]`;\n}\n\nfunction debugLogFooter(name: string) {\n return `[clerk debug end: ${name}] (@clerk/nextjs=${PACKAGE_VERSION},next=${nextPkg.version},timestamp=${Math.round(new Date().getTime() / 1_000)})`;\n}\n\n// ref: https://stackoverflow.com/questions/57769465/javascript-truncate-text-by-bytes-length\nfunction truncate(str: string, maxLength: number) {\n const encoder = new TextEncoder();\n const decoder = new TextDecoder('utf-8');\n\n const encodedString = encoder.encode(str);\n const truncatedString = encodedString.slice(0, maxLength);\n\n // return the truncated string, removing any replacement characters that result from partially truncated characters\n return decoder.decode(truncatedString).replace(/\\uFFFD/g, '');\n}\n"],"mappings":";AAEA,OAAO,aAAa;AAEpB,SAAS,oBAAoB;AAWtB,MAAM,oBAAoB,CAAC,MAAc,cAAyC,MAAc;AACrG,QAAM,UAAsB,CAAC;AAC7B,MAAI,YAAY;AAEhB,SAAO;AAAA,IACL,QAAQ,MAAM;AACZ,kBAAY;AAAA,IACd;AAAA,IACA,OAAO,IAAI,SAAS;AAClB,UAAI,WAAW;AACb,gBAAQ,KAAK,KAAK,IAAI,SAAQ,OAAO,QAAQ,aAAa,IAAI,IAAI,GAAI,CAAC;AAAA,MACzE;AAAA,IACF;AAAA,IACA,QAAQ,MAAM;AACZ,UAAI,WAAW;AACb,gBAAQ,IAAI,eAAe,IAAI,CAAC;AAMhC,mBAAW,OAAO,SAAS;AACzB,cAAI,SAAS,UAAU,GAAG;AAE1B,mBAAS,OACN,MAAM,IAAI,EACV,IAAI,OAAK,KAAK,CAAC,EAAE,EACjB,KAAK,IAAI;AAGZ,cAAI,QAAQ,IAAI,QAAQ;AACtB,qBAAS,SAAS,QAAQ,IAAI;AAAA,UAChC;AAEA,kBAAQ,IAAI,MAAM;AAAA,QACpB;AAEA,gBAAQ,IAAI,eAAe,IAAI,CAAC;AAAA,MAClC;AAAA,IACF;AAAA,EACF;AACF;AAOO,MAAM,aAAyB,CAAC,qBAAqB,gBAAgB;AAC1E,UAAQ,IAAI,SAAc;AACxB,UAAM,UACJ,OAAO,wBAAwB,WAC3B,kBAAkB,qBAAqB,YAAY,IACnD;AAEN,UAAM,SAAS,QAAQ;AACvB,UAAM,UAAU,YAAY,MAAa;AAEzC,QAAI;AACF,YAAM,MAAM,QAAQ,GAAG,IAAI;AAC3B,UAAI,OAAO,QAAQ,YAAY,UAAU,OAAO,OAAO,IAAI,SAAS,YAAY;AAC9E,eAAO,IACJ,KAAK,CAAC,QAAa;AAClB,iBAAO,OAAO;AACd,iBAAO;AAAA,QACT,CAAC,EACA,MAAM,CAAC,QAAa;AACnB,iBAAO,OAAO;AACd,gBAAM;AAAA,QACR,CAAC;AAAA,MACL;AAEA,aAAO,OAAO;AACd,aAAO;AAAA,IACT,SAAS,KAAU;AACjB,aAAO,OAAO;AACd,YAAM;AAAA,IACR;AAAA,EACF;AACF;AAEA,SAAS,eAAe,MAAc;AACpC,SAAO,uBAAuB,IAAI;AACpC;AAEA,SAAS,eAAe,MAAc;AACpC,SAAO,qBAAqB,IAAI,oBAAoB,OAAe,SAAS,QAAQ,OAAO,cAAc,KAAK,OAAM,oBAAI,KAAK,GAAE,QAAQ,IAAI,GAAK,CAAC;AACnJ;AAGA,SAAS,SAAS,KAAa,WAAmB;AAChD,QAAM,UAAU,IAAI,YAAY;AAChC,QAAM,UAAU,IAAI,YAAY,OAAO;AAEvC,QAAM,gBAAgB,QAAQ,OAAO,GAAG;AACxC,QAAM,kBAAkB,cAAc,MAAM,GAAG,SAAS;AAGxD,SAAO,QAAQ,OAAO,eAAe,EAAE,QAAQ,WAAW,EAAE;AAC9D;","names":[]}
@@ -2,7 +2,6 @@ import { OrganizationProfile as BaseOrganizationProfile, SignIn as BaseSignIn, S
2
2
  import type { ComponentProps } from 'react';
3
3
  import React from 'react';
4
4
  export { APIKeys, CreateOrganization, GoogleOneTap, OrganizationList, OrganizationSwitcher, PricingTable, SignInButton, SignInWithMetamaskButton, SignOutButton, SignUpButton, TaskChooseOrganization, TaskResetPassword, TaskSetupMFA, UserAvatar, UserButton, Waitlist, HandleSSOCallback, } from '@clerk/react';
5
- export { OAuthConsent } from '@clerk/react/internal';
6
5
  export declare const UserProfile: typeof BaseUserProfile;
7
6
  export declare const OrganizationProfile: typeof BaseOrganizationProfile;
8
7
  export declare const SignIn: (props: ComponentProps<typeof BaseSignIn>) => React.JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"uiComponents.d.ts","sourceRoot":"","sources":["../../../src/client-boundary/uiComponents.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,IAAI,uBAAuB,EAC9C,MAAM,IAAI,UAAU,EACpB,MAAM,IAAI,UAAU,EACpB,WAAW,IAAI,eAAe,EAC/B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EACL,OAAO,EACP,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,YAAY,EACZ,YAAY,EACZ,wBAAwB,EACxB,aAAa,EACb,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,UAAU,EACV,QAAQ,EACR,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAMrD,eAAO,MAAM,WAAW,EAAE,OAAO,eAKhC,CAAC;AAMF,eAAO,MAAM,mBAAmB,EAAE,OAAO,uBAKxC,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,OAAO,cAAc,CAAC,OAAO,UAAU,CAAC,sBAE9D,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,OAAO,cAAc,CAAC,OAAO,UAAU,CAAC,sBAE9D,CAAC"}
1
+ {"version":3,"file":"uiComponents.d.ts","sourceRoot":"","sources":["../../../src/client-boundary/uiComponents.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,IAAI,uBAAuB,EAC9C,MAAM,IAAI,UAAU,EACpB,MAAM,IAAI,UAAU,EACpB,WAAW,IAAI,eAAe,EAC/B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EACL,OAAO,EACP,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,YAAY,EACZ,YAAY,EACZ,wBAAwB,EACxB,aAAa,EACb,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,UAAU,EACV,QAAQ,EACR,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAMtB,eAAO,MAAM,WAAW,EAAE,OAAO,eAKhC,CAAC;AAMF,eAAO,MAAM,mBAAmB,EAAE,OAAO,uBAKxC,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,OAAO,cAAc,CAAC,OAAO,UAAU,CAAC,sBAE9D,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,OAAO,cAAc,CAAC,OAAO,UAAU,CAAC,sBAE9D,CAAC"}
@@ -3,6 +3,5 @@
3
3
  * If you do, app router will break.
4
4
  */
5
5
  export { MultisessionAppSupport } from './client-boundary/controlComponents';
6
- export { OAuthConsent } from './client-boundary/uiComponents';
7
6
  export { useOAuthConsent } from '@clerk/shared/react';
8
7
  //# sourceMappingURL=internal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../src/internal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../src/internal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const errorThrower: import("@clerk/shared/index-DeNh_jN1").ir;
1
+ export declare const errorThrower: import("@clerk/shared/index-ZRXKVsvy").rr;
2
2
  //# sourceMappingURL=errorThrower.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clerk/nextjs",
3
- "version": "7.1.0-snapshot.v20260413174426",
3
+ "version": "7.1.0",
4
4
  "description": "Clerk SDK for NextJS",
5
5
  "keywords": [
6
6
  "clerk",
@@ -72,9 +72,9 @@
72
72
  "dependencies": {
73
73
  "server-only": "0.0.1",
74
74
  "tslib": "2.8.1",
75
- "@clerk/react": "6.3.0-snapshot.v20260413174426",
76
- "@clerk/backend": "3.2.9-snapshot.v20260413174426",
77
- "@clerk/shared": "4.7.0-snapshot.v20260413174426"
75
+ "@clerk/backend": "^3.2.9",
76
+ "@clerk/react": "^6.3.0",
77
+ "@clerk/shared": "^4.7.0"
78
78
  },
79
79
  "devDependencies": {
80
80
  "crypto-es": "^2.1.0",