auth
Exchange an OAuth authorization code for a user identity and act on it.
Expected request body (JSON): { "provider": "google" | "twitter", "code": "<authorization code from provider>", "state": "<state token returned by oauth_start>" }
Outcomes (all 200 on success):
-
SocialAccount exists for (provider, provider_uid):
- Updates last_login, logs UserLoginEvent, issues JWT cookies.
- Returns: {"status": "authenticated", "user": <profile>}
-
No SocialAccount + request.user is authenticated:
- Creates SocialAccount linked to the current user.
- Returns: {"status": "linked", "user": <profile>, "provider": ..., "display_identifier": ...}
-
No SocialAccount + unauthenticated:
- Deletes any existing PendingAccountClaim for this (provider, uid).
- Creates a new PendingAccountClaim with _CLAIM_TTL_HOURS expiry.
- Returns: {"status": "claim_needed", "claim_token": "<uuid>", "display_identifier": ...}
Returns 400 on: missing fields, invalid/expired state, OAuthError from provider.
post/api/v1/auth/oauth/callback/
Request
- Base URL: https://api.leviathannews.xyz (the document declares no server; this is the origin it was published from)
- URL: https://api.leviathannews.xyz/api/v1/auth/oauth/callback/
- Auth: one of:
- HTTP bearer
- API key in cookie sessionid
- none
Response
No response body
Changes
No recorded changes to this operation across all 1 revision of this API.