René's URL Explorer Experiment


Title: fix(desktop): stop the OAuth connect callback from failing on a bare-path callback URL by icecrasher321 · Pull Request #7005 · simstudioai/sim · GitHub

Open Graph Title: fix(desktop): stop the OAuth connect callback from failing on a bare-path callback URL by icecrasher321 · Pull Request #7005 · simstudioai/sim

X Title: fix(desktop): stop the OAuth connect callback from failing on a bare-path callback URL by icecrasher321 · Pull Request #7005 · simstudioai/sim

Description: Summary Connecting an account from the desktop app failed with a 500 on /api/auth/oauth2/callback/ after the provider had already authorized — the browser landed on "This page isn't working" and no credential was created. The desktop connect launcher passed better-auth a same-origin path as its callbackURL. Better Auth stores that value verbatim in the OAuth state, and the callback's credential-draft reader parsed it with a bare new URL(), which rejects a path. The throw happened inside the account.create.before database hook, which better-auth's OAuth callback does not guard, so it escaped as a 500 instead of a failed connection. Fixed at both levels: the connect page now sends an absolute URL, matching its own workspace-scoped branch and every other connect surface; and the draft reader accepts a path-absolute callback URL so this shape can never fail the callback again. Protocol-relative and malformed values still throw, so an unreadable binding stays loud. Scope was the desktop modal/reconnect flow only. Web is unaffected (it already built an absolute URL), and so was the desktop chat-chip flow, which routes through /api/auth/oauth2/authorize with an absolute callback. Type of Change Bug fix Testing New app/desktop/connect/page.test.tsx pins the launcher's complete URL as absolute (with and without a credential draft) and keeps the workspace-scoped authorize redirect covered. Verified both new tests fail against the old code with the exact TypeError: Invalid URL. Extended lib/credentials/draft-processor.test.ts for the path-absolute callback URL, plus the protocol-relative value that must still throw. bun run test lib/credentials app/desktop lib/auth — 662 passing; bun run type-check; bun run lint; bun run check:audits (33/33, incl. check:api-validation:strict and check:client-boundary). Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Open Graph Description: Summary Connecting an account from the desktop app failed with a 500 on /api/auth/oauth2/callback/<provider> after the provider had already authorized — the browser landed on "This page...

X Description: Summary Connecting an account from the desktop app failed with a 500 on /api/auth/oauth2/callback/&lt;provider&gt; after the provider had already authorized — the browser landed on &qu...

Opengraph URL: https://github.com/simstudioai/sim/pull/7005

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:d638f3d9-b691-d0f7-df17-58dd578bffc9
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id920E:3C597D:135CC5:1B323B:6AFB4C89
html-safe-noncea9276355b7d24f22f1b706d8bc41bf2673c2d6c4b6b293bc0c08a2af2c770ff3
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MjBFOjNDNTk3RDoxMzVDQzU6MUIzMjNCOjZBRkI0Qzg5IiwidmlzaXRvcl9pZCI6IjQyMjAxOTk2Njk1ODc0NjMzMDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmace0dc94edd0a5c9e8ea60db2c109746a6337c854387ee63897be604d42a320d3f
hovercard-subject-tagpull_request:4340464656
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/7005/files
twitter:imagehttps://avatars.githubusercontent.com/u/17950982?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/17950982?s=400&v=4
og:image:altSummary Connecting an account from the desktop app failed with a 500 on /api/auth/oauth2/callback/<provider> after the provider had already authorized — the browser landed on "This page...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneacf7616d06cc051644705b379878c9bb13dc5e70ecf4ffd9b34140f8ac01d7e1
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release26504db649b58525278f77a52b80ba5f10d5f4de
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/7005/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F7005%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F7005%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/7005/files
Reloadhttps://github.com/simstudioai/sim/pull/7005/files
Reloadhttps://github.com/simstudioai/sim/pull/7005/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests197 (197)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
TheodoreSpeakshttps://github.com/TheodoreSpeaks
staginghttps://github.com/simstudioai/sim/tree/staging
fix/desktop-oauth-connect-callbackhttps://github.com/simstudioai/sim/tree/fix/desktop-oauth-connect-callback
Conversation 21 https://github.com/simstudioai/sim/pull/7005
Commits 4 https://github.com/simstudioai/sim/pull/7005/commits
Checks 30 https://github.com/simstudioai/sim/pull/7005/checks
Files changed https://github.com/simstudioai/sim/pull/7005/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7005/files
fix(desktop): stop the OAuth connect callback from failing on a bare-path callback URL https://github.com/simstudioai/sim/pull/7005/files#top
Show all changes 4 commits https://github.com/simstudioai/sim/pull/7005/files
fbd094d fix(desktop): stop the OAuth connect callback from failing on a bare-… Aug 23, 2026 https://github.com/simstudioai/sim/pull/7005/commits/fbd094d3e3f156db45543c6ed528345d770cc20a
d9b50f1 fix(desktop): compose the connect completion URL through the URL API Aug 23, 2026 https://github.com/simstudioai/sim/pull/7005/commits/d9b50f140de26d8d19e0f7a466197f462ab85803
5e8e10b fix(urls): give base URLs the no-trailing-slash form their call sites… Aug 23, 2026 https://github.com/simstudioai/sim/pull/7005/commits/5e8e10be5d75d776d73bf2b44ea99135ae9e97d3
e57f284 chore(urls): stop claiming path-prefixed base URLs are supported Aug 23, 2026 https://github.com/simstudioai/sim/pull/7005/commits/e57f284afd6872bc68d5ab3c62cf0713f1314a33
Clear filters https://github.com/simstudioai/sim/pull/7005/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7005/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7005/files
connect-launcher.tsx https://github.com/simstudioai/sim/pull/7005/files#diff-df0a47b37c9ba4247a11e2ce1c377d3decbf4df8ce4c8ee6e8712a670e8d3ceb
page.test.tsx https://github.com/simstudioai/sim/pull/7005/files#diff-43440b1c32779dab5e1d0489c4f6f09c7d6bb0e69e32617a51af8197c5091c23
page.tsx https://github.com/simstudioai/sim/pull/7005/files#diff-df6bddb5bb98b14315f256660726a6348f1dfff4698b164d3c6435f44e5d5c6d
internal-api-base-url.test.ts https://github.com/simstudioai/sim/pull/7005/files#diff-96ae7c9e100197c5d4bfdb851a7b8a4e23dcd5ef98232f14bcb7a79218771668
urls.test.ts https://github.com/simstudioai/sim/pull/7005/files#diff-2d9858bd35e3d8ecb2256554f3eca4bfc6d15ae2b888d5c50f3d9a248ad3c33a
urls.ts https://github.com/simstudioai/sim/pull/7005/files#diff-61a77ed2b5f1f3a5f3555781240f9bcac5010a54c4535397b4f37f82fbeb127a
draft-processor.test.ts https://github.com/simstudioai/sim/pull/7005/files#diff-7268929c94c6bea43d80f0360d4c7eb7e9c98fa97fa7343c41ea7642c126d1d9
draft-processor.ts https://github.com/simstudioai/sim/pull/7005/files#diff-4a937229edf40920901228f078a5cccfd3b62254852798c0910f00759f55a8d4
urls.mock.ts https://github.com/simstudioai/sim/pull/7005/files#diff-01254f6a64bc85bbbe0e2a2dc9d37071f68508644aa7dbc8f5764cce418d27ab
apps/sim/app/desktop/connect/connect-launcher.tsxhttps://github.com/simstudioai/sim/pull/7005/files#diff-df0a47b37c9ba4247a11e2ce1c377d3decbf4df8ce4c8ee6e8712a670e8d3ceb
View file https://github.com/simstudioai/sim/blob/e57f284afd6872bc68d5ab3c62cf0713f1314a33/apps/sim/app/desktop/connect/connect-launcher.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7005/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7005/files#diff-df0a47b37c9ba4247a11e2ce1c377d3decbf4df8ce4c8ee6e8712a670e8d3ceb
https://github.com/simstudioai/sim/pull/7005/files#diff-df0a47b37c9ba4247a11e2ce1c377d3decbf4df8ce4c8ee6e8712a670e8d3ceb
https://github.com/simstudioai/sim/pull/7005/files#diff-df0a47b37c9ba4247a11e2ce1c377d3decbf4df8ce4c8ee6e8712a670e8d3ceb
https://github.com/simstudioai/sim/pull/7005/files#diff-df0a47b37c9ba4247a11e2ce1c377d3decbf4df8ce4c8ee6e8712a670e8d3ceb
apps/sim/app/desktop/connect/page.test.tsxhttps://github.com/simstudioai/sim/pull/7005/files#diff-43440b1c32779dab5e1d0489c4f6f09c7d6bb0e69e32617a51af8197c5091c23
View file https://github.com/simstudioai/sim/blob/e57f284afd6872bc68d5ab3c62cf0713f1314a33/apps/sim/app/desktop/connect/page.test.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7005/{{ revealButtonHref }}
apps/sim/app/desktop/connect/page.tsxhttps://github.com/simstudioai/sim/pull/7005/files#diff-df6bddb5bb98b14315f256660726a6348f1dfff4698b164d3c6435f44e5d5c6d
View file https://github.com/simstudioai/sim/blob/e57f284afd6872bc68d5ab3c62cf0713f1314a33/apps/sim/app/desktop/connect/page.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7005/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7005/files#diff-df6bddb5bb98b14315f256660726a6348f1dfff4698b164d3c6435f44e5d5c6d
Please reload this pagehttps://github.com/simstudioai/sim/pull/7005/files
https://github.com/simstudioai/sim/pull/7005/files#diff-df6bddb5bb98b14315f256660726a6348f1dfff4698b164d3c6435f44e5d5c6d
https://github.com/simstudioai/sim/pull/7005/files#diff-df6bddb5bb98b14315f256660726a6348f1dfff4698b164d3c6435f44e5d5c6d
Please reload this pagehttps://github.com/simstudioai/sim/pull/7005/files
https://github.com/simstudioai/sim/pull/7005/files#diff-df6bddb5bb98b14315f256660726a6348f1dfff4698b164d3c6435f44e5d5c6d
apps/sim/lib/core/utils/internal-api-base-url.test.tshttps://github.com/simstudioai/sim/pull/7005/files#diff-96ae7c9e100197c5d4bfdb851a7b8a4e23dcd5ef98232f14bcb7a79218771668
View file https://github.com/simstudioai/sim/blob/e57f284afd6872bc68d5ab3c62cf0713f1314a33/apps/sim/lib/core/utils/internal-api-base-url.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7005/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7005/files#diff-96ae7c9e100197c5d4bfdb851a7b8a4e23dcd5ef98232f14bcb7a79218771668
https://github.com/simstudioai/sim/pull/7005/files#diff-96ae7c9e100197c5d4bfdb851a7b8a4e23dcd5ef98232f14bcb7a79218771668
https://github.com/simstudioai/sim/pull/7005/files#diff-96ae7c9e100197c5d4bfdb851a7b8a4e23dcd5ef98232f14bcb7a79218771668
apps/sim/lib/core/utils/urls.test.tshttps://github.com/simstudioai/sim/pull/7005/files#diff-2d9858bd35e3d8ecb2256554f3eca4bfc6d15ae2b888d5c50f3d9a248ad3c33a
View file https://github.com/simstudioai/sim/blob/e57f284afd6872bc68d5ab3c62cf0713f1314a33/apps/sim/lib/core/utils/urls.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7005/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7005/files#diff-2d9858bd35e3d8ecb2256554f3eca4bfc6d15ae2b888d5c50f3d9a248ad3c33a
https://github.com/simstudioai/sim/pull/7005/files#diff-2d9858bd35e3d8ecb2256554f3eca4bfc6d15ae2b888d5c50f3d9a248ad3c33a
apps/sim/lib/core/utils/urls.tshttps://github.com/simstudioai/sim/pull/7005/files#diff-61a77ed2b5f1f3a5f3555781240f9bcac5010a54c4535397b4f37f82fbeb127a
View file https://github.com/simstudioai/sim/blob/e57f284afd6872bc68d5ab3c62cf0713f1314a33/apps/sim/lib/core/utils/urls.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7005/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7005/files#diff-61a77ed2b5f1f3a5f3555781240f9bcac5010a54c4535397b4f37f82fbeb127a
https://github.com/simstudioai/sim/pull/7005/files#diff-61a77ed2b5f1f3a5f3555781240f9bcac5010a54c4535397b4f37f82fbeb127a
https://github.com/simstudioai/sim/pull/7005/files#diff-61a77ed2b5f1f3a5f3555781240f9bcac5010a54c4535397b4f37f82fbeb127a
https://github.com/simstudioai/sim/pull/7005/files#diff-61a77ed2b5f1f3a5f3555781240f9bcac5010a54c4535397b4f37f82fbeb127a
apps/sim/lib/credentials/draft-processor.test.tshttps://github.com/simstudioai/sim/pull/7005/files#diff-7268929c94c6bea43d80f0360d4c7eb7e9c98fa97fa7343c41ea7642c126d1d9
View file https://github.com/simstudioai/sim/blob/e57f284afd6872bc68d5ab3c62cf0713f1314a33/apps/sim/lib/credentials/draft-processor.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7005/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7005/files#diff-7268929c94c6bea43d80f0360d4c7eb7e9c98fa97fa7343c41ea7642c126d1d9
https://github.com/simstudioai/sim/pull/7005/files#diff-7268929c94c6bea43d80f0360d4c7eb7e9c98fa97fa7343c41ea7642c126d1d9
Please reload this pagehttps://github.com/simstudioai/sim/pull/7005/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7005/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.