| 1 | # Native accounts and browser return |
| 2 | |
| 3 | User direction, 2026-09-13: all Oficina apps use the Eleven account model. Open |
| 4 | the most recent account; Back returns to saved accounts; adding an account keeps |
| 5 | existing sessions. Explicit Sign out revokes only the selected native session. |
| 6 | Store opaque credentials in per-app Keychain entries keyed by account UUID; |
| 7 | UserDefaults stores only display names, server origins and the most recent ID. |
| 8 | Migrate the existing origin-keyed credential only after its new entry is saved. |
| 9 | Account switches recreate workspace models so content cannot cross accounts. |
| 10 | |
| 11 | Use ASWebAuthenticationSession for system browser authentication and normal |
| 12 | browser session sharing, allowing existing Home sessions when the server enables |
| 13 | Home. Each app registers works.oficina.<app> as its custom URL scheme. The server |
| 14 | accepts only the exact callback for its app; after explicit browser approval it |
| 15 | returns a random request ID, never a credential. Only the originating app's |
| 16 | verifier can exchange approval for a session. Reject foreign/stale callbacks. |
| 17 | Old servers may ignore callbacks; in-app polling still dismisses the authentication |
| 18 | session after a successful proof exchange. Cancellation invalidates pending work. |
| 19 | |
| 20 | Sheets library: shape-only native thumbnail rows; top-right More menu for Import, |
| 21 | appearance and Sign out; native bottom search and New toolbar; Accounts back |
| 22 | button is disabled while edits or writes need completion. Editor-to-library Back |
| 23 | keeps the editor model alive, preserving existing draft protection. |
| 24 | |
| 25 | Meet retains its existing meeting/invitation-bound Go sign-in protocol. Its verified |
| 26 | result is adopted through NativeConnection.rememberSession, which validates the |
| 27 | canonical origin and cookie format before saving. Its browser uses the same system |
| 28 | authentication presenter. Saved account sessions are reused only for meeting links |
| 29 | on the same origin; invitation redirects are resolved without forwarding cookies |
| 30 | to another origin. Adding another Meet account starts a new explicit browser proof. |
| 31 | |