Repository navigation
Redirect Bluesky sign-ins to the scheme Cyd registers - #20
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, registerssocial.cyd.api(social.cyd.dev-apifor 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://pathparses as a host namedpath, 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 buildsucceeds, and the built bundles containsocial.cyd.api:/atproto-oauth-callback/andsocial.cyd.dev-api:/atproto-oauth-callback/, with no remainingcyd-dev://bluesky-oauthanywhere 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, andcyd.socialsits behind caches that nothing in these repos controls. Hard-reload the page when verifying.🤖 Generated with Claude Code