Multi-server login: choose your server (Mastodon-style, no key needed) #712
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority/Critical
Priority/High
Priority/Low
Priority/Medium
Reviewed/Confirmed
Reviewed/Duplicate
Reviewed/Invalid
Reviewed/Won't Fix
Status/Abandoned
Status/Blocked
Status/Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
project-halkyon/halkyon-learn!712
Loading…
Reference in a new issue
No description provided.
Delete branch "refs/pull/712/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds a "choose your server" step to the auth flows so a learner logs in by
picking/typing a server domain instead of the app silently defaulting to the
cloud project. Companion infra PR (serves the discovery document):
https://codeberg.org/project-halkyon/halkyon-infra/compare/main...instance-discovery-endpoint
Builds on the already-merged native registry-persistence fix.
What changes
domain (discovered via
/.well-known/halkyon-learn.json, so no publishablekey is entered) or a one-tap of the compiled-in default — then credentials.
InstanceDiscoveryServiceresolves a domain →{supabaseUrl, anonKey}from the public well-known document (the Supabase analogue of Mastodon's
/api/v1/instance; the anon key is publishable). Typed errors(invalidDomain / network / notFound / malformed) drive the UI messages.
resolveSignedInRecord): the first login (or are-login of the same server+user) adopts the primary slot — keeping the legacy
DB + session key, so an upgrading user's data is reused and no placeholder is
left behind — while any other (server, user) becomes its own isolated account.
activeContextKey: re-pointingthe primary slot keeps
accountId='primary', so without this the routerwouldn't rebuild and a fresh sign-in wouldn't navigate past the login screen.
AuthBloc+ sign-in/up forms (sign-out already callsAuthRepository.signOutdirectly); screens driveAccountManager.Testing
flutter analyzeclean on touched files. 65 auth + multi_account tests pass(new: 5 sign-in, 4 sign-up, 7 discovery, 6 account-adoption). Screen tests use a
NoSplashtheme to avoid the pre-existingink_sparkle.fragshader flake.Follow-ups (not in this PR)
.env/.env.buildtolearn.halkyon.liif you'd rather change the default).anonKeymust be filled in and the proxy route added on theserver.