RandomCatLover Claude Sonnet 5 commited on
Commit
68e5370
·
1 Parent(s): 40f139d

Replace Supabase Postgres refresh-token storage with an encrypted cookie

Browse files

Supabase connectivity didn't work out (this sandbox also can't reach
port 5432 directly, and the pooler swap didn't resolve it either).
Per user's direction, drop the Postgres dependency entirely and store
the Google refresh_token in a long-lived, Fernet-encrypted browser
cookie instead (extra-streamlit-components' CookieManager, since
Streamlit page code has no direct access to set real HttpOnly
cookies). Trade-off vs. the DB approach: this is per-browser/device,
not centrally keyed by account -- a new device still needs to click
Connect Drive once. The cookie only ever holds ciphertext; the
decryption key stays server-side in secrets and never reaches the
browser.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

2 files changed +46 -59
Files changed (2)
src/cookie_token_store.pyAdded+46
src/token_store.pyDeleted-59