From a6bf1e8ae8550724abe7e85b52b687793528bd41 Mon Sep 17 00:00:00 2001 From: BilalG1 Date: Wed, 26 Nov 2025 11:36:36 -0800 Subject: [PATCH] convex fix auth config bug (#1031) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary by CodeRabbit * **New Features** * Added new `./convex-auth.config` export path for Convex authentication configuration across all packages. * **Documentation** * Updated documentation and examples with new import paths for Convex auth integration in JavaScript, React, and Next.js projects. ✏️ Tip: You can customize this high-level summary in your review settings. --- examples/convex/convex/auth.config.ts | 2 +- packages/js/package.json | 9 +++++++++ packages/react/package.json | 9 +++++++++ packages/stack/package.json | 9 +++++++++ packages/template/package-template.json | 9 +++++++++ packages/template/package.json | 9 +++++++++ .../template/src/integrations/convex/component/README.md | 6 +++--- .../stack-app/apps/implementations/server-app-impl.ts | 6 ++---- packages/template/tsup.config.ts | 6 +++++- 9 files changed, 56 insertions(+), 9 deletions(-) diff --git a/examples/convex/convex/auth.config.ts b/examples/convex/convex/auth.config.ts index cbe881a7e..87ff56d79 100644 --- a/examples/convex/convex/auth.config.ts +++ b/examples/convex/convex/auth.config.ts @@ -1,4 +1,4 @@ -import { getConvexProvidersConfig } from "@stackframe/stack"; +import { getConvexProvidersConfig } from "@stackframe/stack/convex-auth.config"; export default { providers: getConvexProvidersConfig({ diff --git a/packages/js/package.json b/packages/js/package.json index c7b85a2b3..5d1f54de8 100644 --- a/packages/js/package.json +++ b/packages/js/package.json @@ -23,6 +23,15 @@ "require": { "default": "./dist/integrations/convex/component/convex.config.js" } + }, + "./convex-auth.config": { + "types": "./dist/integrations/convex.d.ts", + "import": { + "default": "./dist/esm/integrations/convex.js" + }, + "require": { + "default": "./dist/integrations/convex.js" + } } }, "homepage": "https://stack-auth.com", diff --git a/packages/react/package.json b/packages/react/package.json index 4e4a796bd..cd4e8ff99 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -23,6 +23,15 @@ "require": { "default": "./dist/integrations/convex/component/convex.config.js" } + }, + "./convex-auth.config": { + "types": "./dist/integrations/convex.d.ts", + "import": { + "default": "./dist/esm/integrations/convex.js" + }, + "require": { + "default": "./dist/integrations/convex.js" + } } }, "homepage": "https://stack-auth.com", diff --git a/packages/stack/package.json b/packages/stack/package.json index 289d2adf1..66cbec25b 100644 --- a/packages/stack/package.json +++ b/packages/stack/package.json @@ -23,6 +23,15 @@ "require": { "default": "./dist/integrations/convex/component/convex.config.js" } + }, + "./convex-auth.config": { + "types": "./dist/integrations/convex.d.ts", + "import": { + "default": "./dist/esm/integrations/convex.js" + }, + "require": { + "default": "./dist/integrations/convex.js" + } } }, "homepage": "https://stack-auth.com", diff --git a/packages/template/package-template.json b/packages/template/package-template.json index cced6aea0..4b9b2ff23 100644 --- a/packages/template/package-template.json +++ b/packages/template/package-template.json @@ -33,6 +33,15 @@ "require": { "default": "./dist/integrations/convex/component/convex.config.js" } + }, + "./convex-auth.config": { + "types": "./dist/integrations/convex.d.ts", + "import": { + "default": "./dist/esm/integrations/convex.js" + }, + "require": { + "default": "./dist/integrations/convex.js" + } } }, "homepage": "https://stack-auth.com", diff --git a/packages/template/package.json b/packages/template/package.json index 22fefbcb5..0bfad5da3 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -24,6 +24,15 @@ "require": { "default": "./dist/integrations/convex/component/convex.config.js" } + }, + "./convex-auth.config": { + "types": "./dist/integrations/convex.d.ts", + "import": { + "default": "./dist/esm/integrations/convex.js" + }, + "require": { + "default": "./dist/integrations/convex.js" + } } }, "homepage": "https://stack-auth.com", diff --git a/packages/template/src/integrations/convex/component/README.md b/packages/template/src/integrations/convex/component/README.md index 62dced981..97eca9372 100644 --- a/packages/template/src/integrations/convex/component/README.md +++ b/packages/template/src/integrations/convex/component/README.md @@ -17,9 +17,9 @@ npx @stackframe/init-stack@latest Next, update or create a file in `convex/auth.config.ts`: ```ts -import { getConvexProvidersConfig } from "@stackframe/js"; // Vanilla JS -// or: import { getConvexProvidersConfig } from "@stackframe/react"; // React -// or: import { getConvexProvidersConfig } from "@stackframe/stack"; // Next.js +import { getConvexProvidersConfig } from "@stackframe/js/convex-auth.config"; // Vanilla JS +// or: import { getConvexProvidersConfig } from "@stackframe/react/convex-auth.config"; // React +// or: import { getConvexProvidersConfig } from "@stackframe/stack/convex-auth.config"; // Next.js export default { providers: getConvexProvidersConfig({ diff --git a/packages/template/src/lib/stack-app/apps/implementations/server-app-impl.ts b/packages/template/src/lib/stack-app/apps/implementations/server-app-impl.ts index 26fcb428f..916916694 100644 --- a/packages/template/src/lib/stack-app/apps/implementations/server-app-impl.ts +++ b/packages/template/src/lib/stack-app/apps/implementations/server-app-impl.ts @@ -13,7 +13,7 @@ import { TeamsCrud } from "@stackframe/stack-shared/dist/interface/crud/teams"; import { UsersCrud } from "@stackframe/stack-shared/dist/interface/crud/users"; import { InternalSession } from "@stackframe/stack-shared/dist/sessions"; import type { AsyncCache } from "@stackframe/stack-shared/dist/utils/caches"; -import { StackAssertionError, throwErr } from "@stackframe/stack-shared/dist/utils/errors"; +import { captureError, StackAssertionError, throwErr } from "@stackframe/stack-shared/dist/utils/errors"; import { ProviderType } from "@stackframe/stack-shared/dist/utils/oauth"; import { runAsynchronously } from "@stackframe/stack-shared/dist/utils/promises"; import { suspend } from "@stackframe/stack-shared/dist/utils/react"; @@ -35,6 +35,7 @@ import { ProjectCurrentServerUser, ServerOAuthProvider, ServerUser, ServerUserCr import { StackServerAppConstructorOptions } from "../interfaces/server-app"; import { _StackClientAppImplIncomplete } from "./client-app-impl"; import { clientVersion, createCache, createCacheBySession, getBaseUrl, getDefaultExtraRequestHeaders, getDefaultProjectId, getDefaultPublishableClientKey, getDefaultSecretServerKey, resolveConstructorOptions } from "./common"; +import { startRegistration, WebAuthnError } from "@simplewebauthn/browser"; import { useAsyncCache } from "./common"; // THIS_LINE_PLATFORM react-like @@ -731,15 +732,12 @@ export class _StackServerAppImplIncomplete