Skip to content

Redirect Bluesky sign-ins to the scheme Cyd registers - #20

Merged
micahflee merged 1 commit into
mainfrom
bluesky-oauth-redirect
Sep 13, 2026
Merged

micahflee merged 1 commit into
mainfrom
bluesky-oauth-redirect

Conversation

@micahflee

Copy link
Copy Markdown
Member

Part of the fix for lockdown-systems/cyd#699, alongside lockdown-systems/cyd-server#197 and lockdown-systems/cyd#704.

Why

Both pages sent the browser to cyd://bluesky-oauth/. No Cyd release has claimed that scheme since 1.1.21. Cyd 1.1.22, released in June and the current download, registers social.cyd.api (social.cyd.dev-api for dev) and handles the path /atproto-oauth-callback/ — so for three months, finishing a Bluesky sign-in has ended here with "unknown protocol" and an app that stayed disconnected.

This page is the only fix that reaches people who already have Cyd installed. The app-side change rides in the next release; this one takes effect as soon as it merges.

What changed

Each page names its own target instead of deciding by window.location.href.includes('redirect-to-cyd-dev') — a test the query string could satisfy on its own, which would have made the prod page hand off to the dev app.

The URL is spelled with a single slash after the colon. A private-use URI scheme has no naming authority (RFC 8252 section 7.1), and scheme://path parses as a host named path, which is not what Cyd matches on.

There is now also a link to the same URL, so a browser that blocks the automatic navigation can be clicked through instead of dead-ending. And the authorization code is no longer written to the browser console — it is account-control material.

Testing

npm run build succeeds, and the built bundles contain social.cyd.api:/atproto-oauth-callback/ and social.cyd.dev-api:/atproto-oauth-callback/, with no remaining cyd-dev://bluesky-oauth anywhere in the output.

Worth knowing when this merges: this repo's Pages workflow runs on pushes to main, so this PR gets no build check of its own, and cyd.social sits behind caches that nothing in these repos controls. Hard-reload the page when verifying.

🤖 Generated with Claude Code

These pages sent the browser to cyd://bluesky-oauth/, which no Cyd release has
claimed since 1.1.21. Since 1.1.22 shipped in June, Cyd has registered
social.cyd.api (social.cyd.dev-api for dev) and handled the path
/atproto-oauth-callback/, so finishing a Bluesky sign-in has ended at an
"unknown protocol" error in the browser.

Each page now names its own target rather than sniffing its own URL for
"redirect-to-cyd-dev", which the query string could match just as well. A
private-use URI scheme has no naming authority, so exactly one slash follows
the colon.

Offer a link to the same URL as well, so a browser that blocks the automatic
navigation can still be clicked through, and stop writing the authorization
code to the browser console.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@micahflee
micahflee merged commit 5881bad into main Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant