diff --git a/.changeset/nice-parrots-sort.md b/.changeset/nice-parrots-sort.md new file mode 100644 index 000000000..301aba2b4 --- /dev/null +++ b/.changeset/nice-parrots-sort.md @@ -0,0 +1,5 @@ +--- +'@keystatic/core': patch +--- + +During onboarding, make sure the Deployed App URL does not have double slashes. diff --git a/packages/keystatic/src/app/onboarding/setup.tsx b/packages/keystatic/src/app/onboarding/setup.tsx index e785ca74b..5d1dc58b5 100644 --- a/packages/keystatic/src/app/onboarding/setup.tsx +++ b/packages/keystatic/src/app/onboarding/setup.tsx @@ -77,7 +77,7 @@ export function KeystaticSetup(props: { config: GitHubConfig }) { parseRepoConfig(props.config.storage.repo).owner } Keystatic`, url: deployedURL - ? `${deployedURL}/keystatic` + ? new URL('/keystatic', deployedURL).toString() : `${window.location.origin}/keystatic`, public: true, redirect_url: `${window.location.origin}/api/keystatic/github/created-app`, @@ -85,7 +85,12 @@ export function KeystaticSetup(props: { config: GitHubConfig }) { `${window.location.origin}/api/keystatic/github/oauth/callback`, `http://127.0.0.1/api/keystatic/github/oauth/callback`, ...(deployedURL - ? [`${deployedURL}/api/keystatic/github/oauth/callback`] + ? [ + new URL( + '/api/keystatic/github/oauth/callback', + deployedURL + ).toString(), + ] : []), ], request_oauth_on_install: true,