feat: M10 — native SSO fixes + staff operations #21
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/m10-native-sso-fix"
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?
Fixes the four issues found in on-device QA and adds the staff-operations surface. Consumes existing backend routes — no backend changes (the companion website PR is dev-only tooling). Verified end-to-end on an emulator against the dev backend.
SSO (native, no browser fallback)
AuthRepository.ssoProviders()returnsAvailable/None/Unavailable(retries once). The login screen renders native SSO, a loading hint, or a retry — the old dead website-login hand-off (which couldn't deep-link a mobile session back, so it hung) is removed.ModalBottomSheetbuilt from discovery; straight through when there's one provider). No website chooser page, no Google SDK.{state, verifier}is persisted via a new encryptedPendingSsoStore.Notifications
verticalScroll-wrapped so a signed-in session's longer menu (which includes Notifications) can't clip on short screens. (The entry/screen already existed onmain; the reported "missing" was an older build predating the feature.)Staff operations (§1, §6.4)
New
STAFF/ADMINmenu access levels + aStaffGate; the backend re-checks role on every/api/v1/admin/**call. Screens over existing routes:Moderation + support need a live sidecar; offline they degrade cleanly (clear error on writes, empty queue on the list).
Verification (emulator)
Native SSO picker → IdP → deep link →
exchange200 → signed in → returns Home; Dashboard site-mode flips/public/statusmaintenance↔live; Content publish/create/delete confirmed in MariaDB; staff entries show for staff only. Builds, lint, and unit tests green (JDK 17 on CI).Companions
RunicGateway/docsfeat(shard): follow the visibility framework and read the Protocol 3.0 profile (#30)RunicGateway/website#91AI disclosure (org policy): authored with Claude Code (Claude Opus); AI-authored commits carry a
Co-Authored-By: Claudetrailer.🤖 Generated with Claude Code
https://claude.ai/code/session_01NgyHnrNa8WwG3doxvxjuCr
On-device, the native SSO buttons never appeared and the flow dumped users on the desktop website login (which can't deep-link a mobile session back), so it hung. Two app-side causes: 1. Discovery conflated "no providers" with "call failed" (ssoProviders() returned emptyList() on any error) and the screen then showed a dead website-login hand-off. Now ssoProviders() returns Available/None/Unavailable, retries once, and the login screen renders native provider buttons, a loading hint, or a retry — never the website login fallback (removed, along with WebsiteUrls.login). 2. The pending {state, verifier} lived only in memory, so a Custom-Tab-induced process eviction lost it and the exchange failed STATE_MISMATCH. Persist it via a new encrypted PendingSsoStore (EncryptedSharedPreferences, mirrors the token store), cleared the moment the callback is consumed so replays still fail closed. SsoAuthManager stays framework-free (store behind an interface). +1 test proving a fresh manager on the persisted store completes (process-death sim); 15/15 SSO tests pass, lint + assembleDebug green (JDK21, -Pksp.incremental=false). Verified end-to-end against the local site via the dev stub IdP: player and admin both sign in natively and receive the correct role. Co-Authored-By: Claude <noreply@anthropic.com>