RandomCatLover Claude Sonnet 5 commited on
Commit
76b596f
·
1 Parent(s): 62e957f

Add saved-players/game-history tabs and persistent Drive access via Supabase

Browse files

- Points Tracker setup now has New Game / Saved Players / Game History
tabs. Game name is picked from history (with a + New game name
fallback) instead of always free-typed; Saved Players and Game
History are read-only browsers backed by sheets_backend.list_players
and the new list_game_names helper.

- st.login() alone can never give us a refresh_token -- Streamlit's
own _auth_callback discards anything but id_token/access_token
before user code runs. Added a separate, one-time Connect Google
Drive flow (src/google_oauth.py) using access_type=offline plus
prompt=consent to force Google to issue one, and store it Fernet-
encrypted in a Supabase Postgres table (src/token_store.py). On
every subsequent login, app.py silently redeems a fresh access
token from the stored refresh_token -- no repeat consent screen.
Falls back to showing the Connect Drive button only when no valid
session token and no usable stored refresh_token exist, and clears
a revoked/invalid stored token instead of looping.

- Simplified [auth] secrets back to identity-only defaults now that
Drive scope/consent lives entirely in the new flow; added a
[supabase] secrets section (db_url, encryption_key).

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

7 files changed +296 -16
Files changed (7)
app.py+91
pages/points_tracker.py+68-9
requirements.txt+3
src/bootstrap_secrets.py+4-7
src/google_oauth.pyAdded+64
src/sheets_backend.py+7
src/token_store.pyAdded+59