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.
Steps to reproduce
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.