You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(be): register the browser a session was created from
Sessions are per account, so a user who wants to sign one browser out has
nothing to name it by. Anchors gain a device registry:
`{id, name, created_at, last_used}` per browser, capped at 20 because the anchor
blob is read on nearly every authenticated path, with a monotonic per-anchor
allocator so ids are never reused.
There is no registration method. The client passes the name it would have
registered with plus whatever id it has cached, and the canister resolves the
rest, so an id the client does not own resolves to a fresh registration rather
than to somebody else's device. At the cap the least recently used record is
dropped rather than the registration failing, which costs that browser its name
in the session list and never costs anyone a sign-in.
Eviction orders on `last_used`, not on `created_at`. Clearing browser storage
loses the cached id, so each wipe enrols a fresh record; ordering by enrolment
would spend the cap evicting the browsers a user actually signs in from while
the churn survives, and since eviction ends the dropped browser's sessions,
that signs them out on a device they never touched. Ordering on use makes each
wipe's throwaway records evict each other instead.
`last_used` is also what the settings list wants to read: "last used" is the
question someone deciding what to sign out is asking, and enrolment does not
answer it.
Devices live on the anchor, so they ride on `identity_info` alongside
`mcp_config` rather than needing a call of their own.
Implements docs/ongoing/revocable-app-sessions.md §9.1, §9.2 (S18, S19, S22).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments