Skip to content

Make the private-dashboard CTA reflect the active runtime #11

Description

@jskoiz

Verified against main at 715c52e.

Impact

The non-public homepage always offers “sign in with GitHub” at /auth/login. That is correct only for a standalone server with OAuth configured. Local Vite/preview mode has no auth middleware; /auth/login falls through to the SPA, where auth is a reserved path and the router renders the homepage again. Local users get a no-op action even though their actual private dashboard is /dashboard backed by authenticated gh.

The browser currently distinguishes only public Worker builds from everything else, so it cannot render truthful actions for local CLI, standalone OAuth-enabled, and standalone OAuth-unconfigured deployments.

Concrete code references

Acceptance criteria

  • The homepage receives or derives an explicit runtime capability: local CLI, standalone OAuth-enabled, standalone OAuth-unconfigured, or public-only Worker.
  • Local Vite and preview present a private-dashboard action that opens /dashboard and accurately mentions authenticated gh.
  • OAuth-enabled standalone deployments present /auth/login.
  • OAuth-unconfigured standalone and public-only Worker deployments explain the limitation/configuration path instead of presenting a dead sign-in action.
  • No homepage private action may silently route back to the same homepage.
  • Update README/runtime documentation for the final capability contract.

Test expectations

  • Factor runtime-to-CTA behavior into a testable boundary and cover every runtime capability above.
  • Update the root App test so the local contract expects /dashboard, not /auth/login.
  • Add or extend hosted-server/static integration coverage for OAuth configured and unavailable modes.
  • Verify local npm run dev or preview behavior without performing an OAuth sign-in, then run npm run check.

Dependencies / order

Independent. Keep the browser/server boundary explicit if runtime capability is server-provided.

Non-goals

  • Implementing OAuth inside Vite.
  • Exposing or copying the local GitHub CLI token into the browser.
  • Changing public /username behavior.
  • Requiring OAuth for local CLI mode.

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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions