Adds account sign-in as the 4th item in the Share menus, against BossConsole's
shared Supabase backend (one user pool) over raw GoTrue REST — no Supabase SDK,
reusing the existing ktor client. Magic-link flow: enter email → GoTrue emails a
link → BossConsole's redirect function emits a bossterm://auth/verify deep link →
BossTerm verifies the token and persists the session. Hidden in embedded builds
(serverName != "bossterm"); the BossConsole backend half is risa-labs-inc/BossConsole#787.
New compose-ui/.../auth/ package:
- BossAccountManager: StateFlow<AccountState>; sendMagicLink (POST /auth/v1/otp,
redirect_to=bossterm://auth/verify), handleAuthDeepLink (POST /auth/v1/verify,
token_hash + verbatim type), signOut, refresh-on-startup.
- AuthModels / AuthStorage: DTOs + parseAuthDeepLink + error mapping; session in
~/.bossterm/auth.json (atomic write, chmod 600 on POSIX, never logged).
- DeepLinkHandler / DeepLinkSocket: new bossterm:// support — macOS
setOpenURIHandler (installed before AWT), Windows/Linux argv + single-instance
loopback forwarder (bounded read, constant-time secret check),
-Dbossterm.debug.deeplink dev hook.
- WindowsProtocolRegistrar: HKCU scheme registration on packaged Windows launches.
- SignInWindow: email → sent (60s resend cooldown) → verifying → signed-in.
Wiring: Main.kt (fun main(args) + DeepLinkHandler.install first thing); macOS
CFBundleURLTypes (build.gradle.kts) + .deb .desktop patch (MimeType + %U) + snap
x-scheme-handler/bossterm; "Sign In…" at all three Share menu sites; a deferred
"Signed in as …" toast.
Generated with [Claude Code](https://claude.com/claude-code)
Adds Sign In as the 4th item in the Share menus, against BossConsole's shared Supabase backend (one user pool) over raw GoTrue REST — no Supabase SDK, reusing the existing ktor client. Magic-link flow: enter email → GoTrue emails a link → BossConsole's redirect function emits
bossterm://auth/verify?token_hash=…&type=…→ BossTerm verifies and persists the session. Hidden in embedded builds (serverName != "bossterm").Backend half: risa-labs-inc/BossConsole#789 (closes #787). Until that ships, the email is BOSS-Console-branded and its link opens BossConsole — the client here is complete and testable via a manually-opened deep link.
New
compose-ui/.../auth/packageStateFlow<AccountState>;sendMagicLink(POST /auth/v1/otp,redirect_to=bossterm://auth/verify),handleAuthDeepLink(POST /auth/v1/verifywithtoken_hash+ verbatimtype),signOut, refresh-on-startup.parseAuthDeepLink+ error mapping; session in~/.bossterm/auth.json(atomic write, chmod 600 on POSIX, never logged).bossterm://support: macOSsetOpenURIHandler(installed before AWT), Windows/Linux argv + single-instance loopback forwarder (bounded read, constant-time secret compare),-Dbossterm.debug.deeplinkdev hook.Wiring
Main.kt(fun main(args)+DeepLinkHandler.installfirst thing); macOSCFBundleURLTypes;.deb.desktoppatch (MimeType +%U); snapx-scheme-handler/bossterm; "Sign In…" at all three Share menu sites; a deferred "Signed in as …" toast.Security (reviewed)
Anon key is byte-identical to BossConsole's already-public fallback (RLS is the gate); tokens chmod-600 + never logged; deeplink params go into a JSON body (no injection); socket secret is 128-bit, owner-only, constant-time-compared.
Tests / verification
:compose-ui:desktopTestauth suite (deeplink parsing incl.token↔token_hash+ verbatimtype, error mapping, storage round-trip/corruption, 600-perms assertion) green; full build green.Manual before release (OS-delivery has no automated coverage): packaged
.appcold-startopen "bossterm://auth/verify?token_hash=…&type=magiclink"; a Linux.deb.desktopcarries the MimeType +%U; Windows HKCU registration. RPM scheme registration is a known gap (jpackage.rpmisn't repacked).Generated with Claude Code