mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
Fix Vercel integration when publishable client keys are missing
This commit is contained in:
parent
a0710f8807
commit
1b3e7f5ba2
@ -84,9 +84,13 @@ export default function PageClient() {
|
||||
description: "Vercel Integration",
|
||||
});
|
||||
|
||||
const publishableClientKey = requirePublishableClientKey
|
||||
? (newKey.publishableClientKey ?? throwErr("Expected publishableClientKey when project.requirePublishableClientKey is true"))
|
||||
: undefined;
|
||||
|
||||
setKeys({
|
||||
projectId: adminApp.projectId,
|
||||
publishableClientKey: newKey.publishableClientKey ?? throwErr("Expected publishableClientKey after creating an API key with hasPublishableClientKey: true"),
|
||||
publishableClientKey,
|
||||
secretServerKey: newKey.secretServerKey ?? throwErr("Expected secretServerKey after creating an API key with hasSecretServerKey: true"),
|
||||
});
|
||||
} finally {
|
||||
@ -160,7 +164,9 @@ export default function PageClient() {
|
||||
</div>
|
||||
) : (
|
||||
<p className="text-xs text-muted-foreground">
|
||||
You'll receive a publishable client key and a secret server key for this project.
|
||||
{requirePublishableClientKey
|
||||
? "You'll receive a publishable client key and a secret server key for this project."
|
||||
: "You'll receive a secret server key for this project."}
|
||||
</p>
|
||||
),
|
||||
},
|
||||
|
||||
@ -164,3 +164,6 @@ A: Add project-level shortcuts to `PROJECT_SHORTCUTS` in `apps/dashboard/src/com
|
||||
|
||||
Q: Which port suffixes are assigned to the two local docs sites?
|
||||
A: `docs` (old docs app) uses suffix `26`, and `docs-mintlify` uses suffix `04`. Keep these in sync across `docs/package.json`, `docs-mintlify/package.json`, `apps/dev-launchpad/public/index.html`, and `apps/dashboard/.env.development` (`NEXT_PUBLIC_STACK_DOCS_BASE_URL` points to old docs on `26`).
|
||||
|
||||
Q: Why did the dashboard Vercel integration throw "Expected publishableClientKey" during key generation?
|
||||
A: In `apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/vercel/page-client.tsx`, the code always asserted `newKey.publishableClientKey` even when `project.requirePublishableClientKey` was false. Fix by only asserting/passing `publishableClientKey` when that project config flag is true.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user