Accounts Phase 4: prefs sync + account/settings panel
- Prefs sync: GET/PUT /api/prefs store Calm Filters/Boundaries on the account. On sign-in the client adopts the account's prefs if present, else seeds them from the device; every change PUTs to the account so tuning follows you across devices. (Login side-effects run under untrack so browsing doesn't re-trigger.) - Account panel: GET /api/account (email, connected sign-in methods, saved count, active sessions); Export my data (GET /api/account/export → JSON download); Sign out everywhere (revoke all sessions); Delete account (cascades to all account data) with an inline confirm. Reachable from You → Account. Deferred to a follow-up: link/unlink a provider (OAuth link-mode) and per-session revoke. 118 tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -59,7 +59,13 @@ export async function logout() {
|
||||
try {
|
||||
await postJSON('/api/auth/logout', {});
|
||||
} finally {
|
||||
auth.user = null;
|
||||
savedIds.clear();
|
||||
clearLocal();
|
||||
}
|
||||
}
|
||||
|
||||
// Clear client auth state without a logout call (cookie already cleared server-side,
|
||||
// e.g. after delete-account or sign-out-everywhere).
|
||||
export function clearLocal() {
|
||||
auth.user = null;
|
||||
savedIds.clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user