Skip to content

Log in to the desktop the same way as Director's Palette (email/password + Google), fix dp_ key auth, enable agent login #9

Description

@taskmasterpeace

Problem

You can't reliably log into the desktop app, and login must work the same way as Director's Palette — same everything. Login is also a prerequisite for the AI agent to authenticate and read/act on your project (timeline, generations) to help you test.

Current state (verified in code)

  • Email/password login exists (Settings → Palette Connection) and authenticates against DP's Supabase project, storing a JWT + refresh token. frontend/components/SettingsModal.tsx (login UI), backend/handlers/sync_handler.py, backend/services/palette_sync_client/palette_sync_client_impl.py.
  • dp_ API-key login is brokenpalette_sync_client_impl.py returns a 404 ("dp_ keys not supported yet") because it validates against Supabase directly instead of DP's already-deployed /api/desktop/me endpoint.
  • No Google sign-in on the desktop, even though directorspal.com supports Google OAuth (directors-palette-v2/src/features/auth/services/auth.service.ts) plus email/password, both via Supabase.
  • DP already exposes authenticateDesktopRequest (accepts a dp_ key or a Supabase JWT) and /api/desktop/me (directors-palette-v2/src/lib/auth/desktop-auth.ts).

Goal — login parity with Director's Palette

  1. Same methods as the web: email/password and Google OAuth, against the same Supabase project, so the same account/credentials work.
  2. Fix the dp_ API-key path by validating against DP's existing https://directorspal.com/api/desktop/me (it already accepts both dp_ keys and JWTs) instead of hitting Supabase directly.
  3. Persistent session — store + auto-refresh the token so the user stays logged in across restarts (refresh-token handling already exists).
  4. Agent login — a logged-in (or dp_-keyed) session must let the AI agent authenticate headlessly to call /api/generations and (future) the timeline/project read API, so it can help test and act on the project.

Investigate first

  • Reproduce the exact failure: does email/password fail, or is the user pasting a dp_ key (the stubbed path)? Capture the error.

Files

Desktop: frontend/components/SettingsModal.tsx, backend/_routes/sync.py, backend/handlers/sync_handler.py, backend/services/palette_sync_client/palette_sync_client_impl.py, backend/state/app_settings.py (palette_api_key, palette_refresh_token).
DP: src/lib/auth/desktop-auth.ts, src/app/api/desktop/me/route.ts, src/features/auth/services/auth.service.ts.

Done when

A user signs in with the same credentials and methods as directorspal.com (including Google), the session persists across restarts, a dp_ key also works, and the AI agent can authenticate to query generations/timeline.

Metadata

Metadata

Assignees

No one assigned

    Labels

    authLogin / authenticationblockerBlocks core usagemvpPart of the core AI-native timeline loop

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions