Skip to content

Credential store incompatibility: sessions refreshed by the rc CLI are invisible to @prisma/cli@latest (3.0.0-beta.30) #204

Description

@ankur-arch

Summary

The rc-line CLI and the 3.x beta CLI share the same auth store (~/Library/Application Support/prisma/auth.json + auth.context.json on macOS), but after the rc CLI refreshes a session, the 3.x CLI reports it as unauthenticated. Anyone using both CLIs on one machine (which the docs currently require: the homepage quickstarts use @latest app deploy, the Compute docs use @next) loses 3.x auth.

Repro (macOS, Node 24.11.1)

  1. Have a stored OAuth session for the active workspace (originally created via auth login).
  2. Run any rc CLI command that refreshes the token, e.g. prisma auth whoami (8.0.0-rc.4, repo-built since published rc crashes — see All published 8.0.0-rc CLIs crash at startup: @prisma/cli-engine@0.1.1 lacks the readActiveAccessToken export #202). It reports authenticated: true, source: "stored" and rewrites the session in auth.json.
  3. Immediately run npx @prisma/cli@latest auth whoami --json (3.0.0-beta.30):
{ "ok": true, "result": { "authenticated": false, "provider": null, "user": null, "workspace": null, "credential": null } }
  1. npx @prisma/cli@latest app deploy … --json --no-interactive then fails AUTH_REQUIRED, even though the rc CLI on the same machine is authenticated and the session entry for the active workspace exists in auth.json (verified: 5 sessions in the file, incl. the active workspace with a fresh expiresAt).

3.x's FileTokenStorage.getTokens() swallows all errors (dist/adapters/token-storage.js, catch → null), so whatever it rejects about the rc-written record is silent. Workaround that unblocked validation: PRISMA_SERVICE_TOKEN, which 3.x honors.

Expected

Either both CLIs read/write a mutually compatible credential record, or the incompatibility is detected and surfaced ("session was written by a newer CLI, run auth login") instead of a silent authenticated: false.

Found while validating the docs against both CLI lines (prisma/web#8151).

🤖 Filed with Claude Code on behalf of datta@prisma.io

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions