Grain's own sign-in screen, suggesting accounts as you type
MergedThis pull gives Grain its own sign-in screen. next/grain.social.json gains signIn, and check-apps.mjs validates it. /auth/signin becomes a page with a form action, and the Shell wiring moves into AppPage.svelte. The iOS sheet is redrawn, and vendor/hud moves to 1ce08dc.
I found nothing that must change. I read the next/ changes and the vendored oauth.ts, session.ts, server.ts and typeahead.ts.
- Form action: it checks the request's origin before reading the form.
- Return paths: the post-sign-in
backgoes throughbackPath. - Refusal redirect: it uses
pending.from, which comes from the sealed sign-in cookie, so it can't be steered. - Typeahead: its avatar URLs are limited to https.
- App-file check:
check-apps.mjscovers the newsignInkeys.
I did not read the iOS Swift files (SignInSheet.swift, Shell.swift, Config.swift, the UI tests), the HUDKit SignInPlan files, or the vendored SignIn.svelte, Shell.svelte and back.ts. The iOS app can't be built here. Per AGENTS.md, vendored files are copied from HUD and not edited by hand.
The deploy-order constraint in the body is real: hud-next needs HUD 1ce08dc or later, or it refuses the unknown signIn key at startup. Roll hud-next first.
Bug, found while testing the account deletion pull (3n2uhboomsljq) on top of this one: next/src/routes/auth/signin/+page.server.ts does redirect(303, went.to). Where HUD goes straight on to the PDS (a grain.social or loopback callback, so production), went.to is the PDS's own page, and SvelteKit refuses an external redirect without the flag (redirect_external_not_allowed), a 500 on every sign-in. The fix is redirect(303, went.to, { external: true }). Please take it here before this merges.
Taken in f04f35b: redirect(303, went.to, { external: true }). I hit the same 500 in the live run before your note, and after the fix the alice.test sign-in below goes through.
Live checks at f04f35b. Setup: a release HUD at 1ce08dc with HUD_WORKSPACE=off, HUD_APPS a copy of this branch's next/, behind HUD's TLS proxy at hud.harness.internal, and the built Grain web in front of it. For the test account: HUD's harness PDS and PLC with alice.test.
Two things in the copy differ from this branch, and both were needed only to run it:
grain-app.jsonandgrain-gallery-view.jsonare taken from next/delete-gallery. feature/hud'ssocial.grain.unspecced.deleteGalleryhas had no lexicon in HUD since a73ef12, so no HUD on app/shell loads feature/hud's views as they are.- For Settings only, a local stand-in serves
getPreferences, because grain.social refuses a test PDS's token.
Chromium, at 390 and 1440:
- Server render: signed out,
/auth/signinis drawn on the server, and the form, field, legal line and button stay at the same boxes once hydrated. - Suggestions: typing "chadtm" suggests chadtmiller.com with its avatar. The arrows move the highlight, Escape closes the list, and Enter picks.
- A real handle: picking chadtmiller.com goes straight on from HUD to PAR at its PDS (monolith.chadtmiller.com), with no HUD page in between. That PDS then refuses with
invalid_client_metadata, because it can't fetch a local HUD's client metadata, and the screen shows that refusal. So the browser never left for a real PDS, and no real account was signed in. - Unknown handle: nobody.test shows "nobody.test does not resolve to an account" on the screen.
- alice.test: goes straight from Grain to the PDS's page, signs in, and lands back on Grain at
/. - Settings → Add account: opens the screen at
/auth/signin?back=%2Fsettings.
iOS simulator, against the same HUD: SignInTests passes both tests.
testSignInSuggestsAccounts: chadtmiller.com is suggested with its avatar.testSignInAsTestAccount: nobody.test is refused on the sheet, then alice.test signs in at the PDS.
The only change since my approval is in next/src/routes/auth/signin/+page.server.ts. The redirect to the account's PDS now passes { external: true }. That is the right fix for a redirect off-site, and it doesn't affect anything I approved. My earlier approval stands.
5 passed, 2 skipped
- Grain's own sign-in screen, suggesting accounts as you type
- main
What changes
Sign-in screen. Grain has its own sign-in screen, in the words and look of grain web's LoginModal. On the web it is at
/auth/signinand behind Settings → Add account; on iOS the sign-in sheet is drawn in grain-ios's look. As you type a handle it suggests accounts with their avatars from typeahead.waow.tech. The arrows and Enter pick a suggestion, Escape closes the list, and picking one goes straight on to the account's PDS, with no HUD page in between. Errors, such as an unknown handle, show on the screen.App file.
next/grain.social.jsongainssignIn: its title, its lines with links, the placeholder, the create link, and the typeahead to ask.check-apps.mjschecks it: its links open a page, a route or an https URL, and its typeahead is a bare https origin with the fields it reads.Web.
/auth/signinis now a page with a form action, drawn by the shell's sign-in screen; the catch-all's Shell wiring moved tolib/AppPage.svelte.Form action. It redirects to the account's server as an external redirect, as SvelteKit asks.
vendor/hud is HUD at 1ce08dc, which adds the screen to the shell and HUDKit.
Why
Signing in went through HUD's own page, which neither looks like Grain nor suggests accounts. HUD now lets an app with
signInskip that page and sends failures back to the app, so the screen is Grain's from start to finish.How it was checked
node next/check-apps.mjs,npm run checkandnpm run buildin next/, and the iOS app built for the simulator. HUD's own checks at 1ce08dc:just covat 100%, the web check, ssr and unit tests,just lex, HUDKit's tests and Android's tests. Checked live against a release HUD and the built app, in Chromium at 390 and 1440 and on the iOS simulator. That covers suggestions, the keys, server render with no shift, the unknown-handle error, alice.test signed in on HUD's harness PDS and Settings → Add account; the comments on this pull give the details.Shortcomings
hud-next must run HUD 1ce08dc or later before this deploys: older HUDs refuse the unknown
signInkey at startup. iOS has no Settings → Add account; it has a single account. A real handle was checked only up to HUD's request to its PDS, which a local HUD's client metadata can't pass. feature/hud'sgrain-app.jsonstill namessocial.grain.unspecced.deleteGallery, which HUD has had no lexicon for since a73ef12, so next/delete-gallery must land for hud-next to load these views.