svc-auth — API Routes
Auto-generated from source on
2026-10-30 15:00 UTC. Do not edit manually — runmake specto regenerate.
/
Source:
modules/svc-auth/main.py
| Method | Path | Handler | Description |
|---|---|---|---|
GET | /login | login | Initiate OAuth login flow. |
GET | /callback | callback | Handle OAuth callback from Auth0. |
GET | /verify | verify_session | Verify session and return user info. |
GET | /logout | logout | Logout user and clear session. |
POST | /logout | logout | Logout user and clear session. |
GET | /me | get_user_info | Get current authenticated user information. |
GET | /sessions | list_sessions | List the caller's currently-active sessions for the account UI. |
GET | /sessions/history | list_session_history | Return a page of the caller's ended sessions, most-recently-ended first. |
POST | /sessions/{session_id}/revoke | revoke_session | Revoke one of the caller's sessions by its UUID. |
DELETE | /sessions/{session_id} | revoke_session | Revoke one of the caller's sessions by its UUID. |
POST | /sessions/revoke-others | revoke_other_sessions | Sign out everywhere except the caller's current session. |
GET | /session/info | get_session_info | Get session information (for debugging in development). |
GET /health
Health check endpoint.
Returns service health and Redis connectivity status.
GET /login
Initiate OAuth login flow.
Query Parameters: return_to: URL to redirect to after successful authentication
Flow:
Generate state and nonce for CSRF protection
Store OAuth state in temporary Redis session
Redirect to Auth0 authorization endpoint
GET /callback
Handle OAuth callback from Auth0.
Query Parameters: code: Authorization code from Auth0 state: State parameter for CSRF validation error: Error code if authentication failed
Flow:
Validate state parameter against stored value
Exchange authorization code for tokens
Extract user info from ID token
Create session and store tokens server-side
Redirect to application with session cookie
GET /verify
Verify session and return user info.
Used by nginx auth_request directive to protect routes.
Headers: X-User-Id: User identifier X-Session-Id: Session identifier
Returns: 200: Session valid 401: Session invalid or expired
GET /logout
Logout user and clear session.
Flow:
Delete session and tokens from Redis
Clear session cookie
Redirect to Auth0 logout endpoint
POST /logout
Logout user and clear session.
Flow:
Delete session and tokens from Redis
Clear session cookie
Redirect to Auth0 logout endpoint
GET /me
Get current authenticated user information.
Returns: User profile data from ID token
Raises: 401: Not authenticated
GET /sessions
List the caller's currently-active sessions for the account UI.
Reconciles state on read: any session still marked active whose Redis key has vanished (idle TTL lapse) is flagged expired and dropped from the response — it surfaces under `/sessions/history` instead. The opaque session token is never included; sessions are addressed by their UUID.
GET /sessions/history
Return a page of the caller's ended sessions, most-recently-ended first.
Covers logged-out, revoked, and expired sessions. `limit is clamped to [1, 100] and offset` to >= 0 to bound the query. The response carries the total ended count so the UI can drive "load more" / pagination.
POST /sessions/{session_id}/revoke
Revoke one of the caller's sessions by its UUID.
Ends the durable record and deletes the matching Redis session/tokens so the next /verify on that session fails. Only the owner may revoke.
Exposed as both `POST /sessions/{id}/revoke and DELETE /sessions/{id}`. The browser uses POST: edge proxies / WAFs (Cloudflare) in front of the deployment frequently block the DELETE method outright (returning 403), so the safe-everywhere mutation verb is POST. DELETE is retained for API clients / backward compatibility.
DELETE /sessions/{session_id}
Revoke one of the caller's sessions by its UUID.
Ends the durable record and deletes the matching Redis session/tokens so the next /verify on that session fails. Only the owner may revoke.
Exposed as both `POST /sessions/{id}/revoke and DELETE /sessions/{id}`. The browser uses POST: edge proxies / WAFs (Cloudflare) in front of the deployment frequently block the DELETE method outright (returning 403), so the safe-everywhere mutation verb is POST. DELETE is retained for API clients / backward compatibility.
GET /session/info
Get session information (for debugging in development).
Only available in development mode.