Skip to content
sign in

GitHub OAuth callback

GET /auth/github/callback

Validates state and exchanges the code. A sign-in redirects to / with the session cookie set. A connect (started with ?next=repos or ?next=barista) attaches the GitHub account to the signed-in user, keeps the session, and redirects to /repos or /barista/setup; without a session it signs in and redirects there.

Request

Parameters

  • code (query, string, required)
  • state (query, string, required)

Responses

302

Redirect to /, /repos or /barista/setup

default

Error as { error: { code, message } }

  • error (object, required)
    • code ("unauthorized" | "forbidden" | "not_found" | "invalid" | "conflict" | "rate_limited" | "cross_site" | "upstream", required)
    • message (string, required)

Example

curl -X GET \
  "https://cupof.ai/auth/github/callback?code=CODE&state=STATE"