Skip to main content

GitHub Login & Token Management


Initiate User Login

GET /api/v1/auth/github/login-user — 🌐 Public

Starts the GitHub OAuth flow for user authentication. Returns the authorization URL to redirect the user to.

curl https://nasiko.dev/api/v1/auth/github/login-user

Connect GitHub Account

For users already logged in who want to connect GitHub for repository access:

GET /api/v1/auth/github/login — 🔒 Requires Auth

Returns a GitHub OAuth URL scoped to repository access.

curl https://nasiko.dev/api/v1/auth/github/login \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Check Token Status

GET /api/v1/auth/github/token — 🔒 Requires Auth

curl https://nasiko.dev/api/v1/auth/github/token \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Response:

{
"has_token": true,
"github_username": "octocat"
}

Logout from GitHub

POST /api/v1/auth/github/logout — 🔒 Requires Auth

Removes your stored GitHub access token.

curl -X POST https://nasiko.dev/api/v1/auth/github/logout \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."