---
title: "Sign in with GitHub"
method: POST
path: "/auth/github"
tags: ["Auth"]
---

# Sign in with GitHub

`POST /auth/github`

## Request

- Base URL: `https://foresea.ink` (the document declares no server; this is the origin it was published from)
- URL: `https://foresea.ink/auth/github`
- Auth: none declared

Exchange a GitHub OAuth `code` for the user's profile and return a session token.

The browser sends users to GitHub's authorize URL, then posts the returned
`code` (and the same `redirect_uri`) here. Store the returned `token` like the
Google flow.

## Request body

- GitHubAuthRequest: GitHub OAuth authorization code returned to the browser.
  - `code` string, required
  - `redirect_uri` string, nullable

## Response `200`

Successful Response

- SessionResponse: Issued after a successful Google sign-in.
  - `token` string, required
  - `user_id` string, required
  - `email` string, required
  - `name` string, required
  - `picture` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/foresea/apis/foresea-intelligence-api.md) · [All operations](https://skmtc.dev/foresea/apis/foresea-intelligence-api/llms.txt) · [OpenAPI document](https://skmtc.dev/foresea/apis/foresea-intelligence-api/revisions/b03e49f4385d?raw)
