diff --git a/CHANGELOG.md b/CHANGELOG.md index 5815588..185e928 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## Unreleased + +- `SessionManager.listForUser(userId)` and + `SessionManager.revokeOthers(userId, keepSessionId)`: list a user's live + sessions and end all but one. Additive; for "sign out other sessions" in an + account page. Implementations of `SessionManager` must add both (core's does). + ## 1.0.0 (2026-11-10) First release: the plugin contract of Dune 0.36. It was declared in slices; this diff --git a/src/identity.ts b/src/identity.ts index 2e97fa5..f2b8145 100644 --- a/src/identity.ts +++ b/src/identity.ts @@ -136,6 +136,14 @@ export interface SessionManager { revoke(sessionId: string): Promise; /** Revoke all sessions for a user. */ revokeAll(userId: string): Promise; + /** + * The user's live (unexpired) sessions, newest first. A session's `id` is the + * bearer credential in its cookie, so never render it in a page: show a + * derived handle and look the session up again server-side to act on it. + */ + listForUser(userId: string): Promise; + /** Revoke all of a user's sessions except `keepSessionId` (the caller's own). */ + revokeOthers(userId: string, keepSessionId: string): Promise; /** Clean up expired sessions. */ cleanup(): Promise; }