Skip to content

GitHub Connect returns 401 when initiated from Account Center #79

@PRERAN001

Description

@PRERAN001

Steps to reproduce

  • Sign in to the app (local auth) in the frontend.
  • Go to Account Center → GitHub card and click "Connect GitHub Account".
  • Frontend navigates the browser to: GET /api/auth/github/connect?redirectPath=/account-center
  • Server responds 401 Unauthorized; user sees no redirect to GitHub.

Actual behavior

The backend route /api/auth/github/connect is protected and expects a Bearer token in the Authorization header.
A direct browser navigation (window.location.href) does not include the token, so the request is unauthenticated and returns 401.
Expected behavior

Clicking "Connect" should initiate a GitHub OAuth flow for the currently signed-in user and redirect the browser to GitHub's consent screen.
Root cause

Frontend was performing a direct browser redirect to a protected backend route, which drops the Authorization header.
The protected route therefore rejects the request with 401.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions