Skip to content
sign in

GitLab OAuth callback

GET /auth/gitlab/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 GitLab account to the signed-in user and redirects to /repos or /barista/setup; a consent round-trip upgrades the signed-in user's connection to the api scope and redirects to /repos, or to /barista/setup when it was started with ?next=barista.

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/gitlab/callback?code=CODE&state=STATE"