Authentication API
Get current user
Section titled “Get current user”GET /api/authReturns the currently authenticated user’s profile.
Response 200 OK
{ "id": "user_abc123", "name": "Your Name", "avatar_url": "https://avatars.githubusercontent.com/u/12345"}Returns 401 Unauthorized if no valid session exists.
Logout
Section titled “Logout”POST /api/authDestroys the current session and logs the user out.
Response 200 OK
GitHub OAuth
Section titled “GitHub OAuth”Initiate login / callback
Section titled “Initiate login / callback”GET /api/auth/githubHandles both initiating the GitHub OAuth flow and processing the callback. When called without parameters, starts the OAuth flow. When called with an authorization code parameter, completes login.
Device flow — Initiate
Section titled “Device flow — Initiate”GET /api/auth/github/deviceStarts the GitHub device authorization flow. Returns a device code and verification URL.
Device flow — Poll
Section titled “Device flow — Poll”GET /api/auth/github/device/pollPoll for device flow completion after the user has entered their code on GitHub.
Check GitHub status
Section titled “Check GitHub status”GET /api/auth/github/statusCheck if the current user has a valid GitHub token connected.
Google OAuth
Section titled “Google OAuth”Initiate login / callback
Section titled “Initiate login / callback”GET /api/auth/googleHandles both initiating the Google OAuth flow and processing the callback. When called without parameters, redirects to Google’s consent screen. When called with a code parameter, completes login and creates a session.