Skip to content

auth status: actively validate stored bearer tokens for headless Server targets #48

Open

Description

@b-pm

Summary

beeper auth status currently reports only whether a token is stored:

const authenticated = Boolean(process.env.BEEPER_ACCESS_TOKEN || target.auth?.accessToken)

That can produce a false "authenticated" result when the selected Server target no longer accepts the token.

A recent #14 follow-up reproduced exactly this on headless Server 4.3.179: the email-login token works for setup/recovery-key verification, then roughly ten minutes later GET /v1/app/setup returns 401 Invalid token / Token not found, while the CLI still has a bearer stored.

Proposed CLI improvement

Add an explicit live validation mode, e.g.:

beeper auth status --check

The command should keep the existing cheap stored-auth snapshot by default, but with --check:

  • send the selected bearer to a lightweight authenticated endpoint such as GET /v1/app/setup
  • distinguish:
    • valid: target accepted the bearer
    • invalid: 401/403
    • unknown: target/network/non-auth failure
  • include the result in JSON output for agents/monitoring
  • never print the token
  • preserve environment-token precedence over stored target auth

Why

The underlying headless token-persistence problem is app/server-side and should be fixed there. The CLI can still stop presenting "token exists on disk" as proof that authentication is usable.

This would also make diagnosis of headless MCP/API failures materially faster because auth validity can be separated from process readiness and data-plane health.

Related: #14.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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