Skip to content

Clear localStorage on sign-out - #647

Closed
tembo[bot] wants to merge 1 commit into
mainfrom
tembo/fix/chat-cache-localstorage-signout
Closed

Clear localStorage on sign-out#647
tembo[bot] wants to merge 1 commit into
mainfrom
tembo/fix/chat-cache-localstorage-signout

Conversation

@tembo

@tembo tembo Bot commented Feb 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixed security vulnerability where chat cache persisted in localStorage after sign-out on shared devices. Changes include:

  • Removed localStorage.setItem() call for chat cache in app-sidebar.tsx - now only uses sessionStorage with minimal fields (_id, title, updatedAt)
  • Updated auth-client.tsx to clear both sessionStorage and localStorage for all sensitive keys (openchat-chats-cache, openchat-prompt-drafts, openchat-stream) during sign-out
  • Renamed SENSITIVE_SESSION_KEYSSENSITIVE_STORAGE_KEYS to reflect dual-storage clearing
  • Cleaned up merge conflict markers in app-sidebar.tsx

Files modified:

  • apps/web/src/components/app-sidebar.tsx
  • apps/web/src/lib/auth-client.tsx

Want tembo to make any changes? Add a review or comment with @tembo and i'll get back to work!

View on Tembo View Agent Settings


Summary by cubic

Stops chat data from persisting in localStorage after sign-out to prevent data leakage on shared devices. Sidebar now caches minimal chat fields in sessionStorage, and sign-out clears sensitive keys from both storages.

  • Bug Fixes
    • Cache only _id, title, and updatedAt in sessionStorage for the sidebar.
    • On sign-out, remove openchat-chats-cache, openchat-prompt-drafts, and openchat-stream from sessionStorage and localStorage.
    • Rename SENSITIVE_SESSION_KEYS to SENSITIVE_STORAGE_KEYS.

Written for commit d312850. Summary will update on new commits.

@vercel

vercel Bot commented Feb 14, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
osschat-web Error Error Feb 14, 2026 3:08am

@tembo tembo Bot added the tembo Pull request created by Tembo label Feb 14, 2026
@railway-app

railway-app Bot commented Feb 14, 2026

Copy link
Copy Markdown

This PR was not deployed automatically as @tembo[bot] does not have access to the Railway project.

In order to get automatic PR deploys, please add @tembo[bot] to your workspace on Railway.

@leoisadev1 leoisadev1 closed this Feb 14, 2026
@tembo
tembo Bot deleted the tembo/fix/chat-cache-localstorage-signout branch February 14, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tembo Pull request created by Tembo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant