Endpoint
Authentication
Required. This endpoint requires a valid GitHub access token obtained through the OAuth flow. Include the token in the Authorization header:Response
The user’s GitHub username.
The user’s email address (from GitHub or generated fallback).
Success Response
Error Responses
401 Unauthorized - Missing Token
401 Unauthorized - Invalid Token
401 Unauthorized - User Not Found
Example Request
cURL
Response
Authentication Middleware
This endpoint uses theAuthMiddleware which:
- Extracts the token from the
Authorizationheader - Validates the token format (must be
Bearer {token}) - Looks up the user in the database by
github_token - Attaches the user object to the request context
- Returns 401 if any validation fails
Implementation Details
- Token is matched against the
github_tokenfield in the database - The GitHub access token from OAuth flow serves as the authentication token
- User object is stored in request context for handler access
- Only returns basic user information (username and email)
Use Cases
- Verify authentication status
- Retrieve current user information for UI display
- Validate token before making other authenticated requests
- Check which GitHub account is currently authenticated