~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

Someone with no account makes one at the host's sign-up PDS, and comes back signed in

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:host/sign-up

What changes

"Create one" signs someone up and back in. The sign-in dialog's "Create one" went to bsky.app in a new tab. It now goes to /console/login?create: the host pushes an OAuth request to the authorization server of SIGNUP_PDS (a new setting, https://bsky.social unless set) with prompt=create and no login_hint, and the server shows its sign-up. On return the token's sub names the account it made; the host resolves it as it would a typed handle, and signs them in only if that account's own authorization server is the one that answered (signed_up in console_login.rs). A create never applies to an account being moved.

The example handle follows the sign-up PDS. getViewer answers signUpAt (SIGNUP_PDS), and the dialog's placeholder is you.<its host>: you.bsky.social, or on the next network you.pds.next.opensocial.fyi.

deploy/docker-compose.yml passes GROUP_HOST_SIGNUP_PDS.

Why

On next.opensocial.fyi, whose accounts live on a PDS of its own, "Create one" sent people to Bluesky, whose accounts can't sign in there.

How it was checked

tests/console_login.rs: a sign-up at a fake sign-up PDS (made before the host, as SIGNUP_PDS is read at start), its pushed request carrying prompt=create and no login_hint, coming back signed in as the new account; refused when the account another server answers for, when it names no account, and when the sign-up PDS can't be reached; neither a handle nor create. tests/config.rs: SIGNUP_PDS's default, trailing slash and refusal. tests/actors.rs: signUpAt signed in and out. e2e: the link and the placeholder.

Shortcomings

  • The example handle assumes a PDS's handles are under its own name, as bsky.social's and next's are.

🤖 Generated with Claude Code

Approved

This adds a sign-up path. "Create one" goes to /console/login?create, and the host pushes prompt=create with no login_hint to SIGNUP_PDS's authorization server. On return, signed_up resolves the token's sub and accepts it only if that account's own authorization server issued the token. I found nothing that must change.

  • Sign-up trust: the sub goes through the same sign_in_at resolution a typed handle gets. The issuer is compared with the one that answered, an empty sub is refused, and the create path is closed to moves (mover.is_none()). The tests cover each of these.
  • Docs and lexicon: config.md, api.md, deploying.md, signing-in.md and the getViewer lexicon are all updated alongside the code.
  • Not checked: I did not read the CI results.
  • Minor: SignInDialog calls new URL(signUpAt).hostname, which throws on a malformed value. The host validates SIGNUP_PDS, so it is only a concern if another host answers getViewer with a bad signUpAt. You could wrap it in a try/catch that falls back to bsky.social.
Merged as a2654e0