Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Onboarding: Guard deployedURL #1373

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/nice-parrots-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystatic/core': patch
---

During onboarding, make sure the Deployed App URL does not have double slashes.
9 changes: 7 additions & 2 deletions packages/keystatic/src/app/onboarding/setup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,20 @@ 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`,
callback_urls: [
`${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,
Expand Down
Loading