Files
dashback/docs/api/routes/auth/login.md
2026-07-31 18:25:42 +02:00

40 lines
794 B
Markdown

# `POST /auth/login`
Public. No cookie required.
Login with Google ID token
Verifies a Google ID token, checks allowlist (or creates entry when `IMPLICIT_CREATE=true`), and sets an HTTP-only `token` cookie.
## Body (JSON)
```json
{
"idToken": "<google-id-token>"
}
```
## Response `200`
Login successful; `token` cookie set
```json
{
"message": "Login successful",
"user": { … }
}
```
## Errors
| Status | Description |
|--------|-------------|
| 400 | Missing token or Google client not configured — `{"error":"…"}` |
| 401 | Invalid Google token or account — `{"error":"…"}` |
| 403 | Email not on allowlist — `{"error":"…"}` |
| 500 | Server error — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._