Login
Authenticate with email and password. Returns a JWT access token and a refresh token (also set as an HttpOnly cookie on the /auth/refresh path).
POSThttps://api.marinahealth.eu/auth/login
application/json
Request Body
Body Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| string | required | Registered email address. | |
| password | string | required | Account password. |
Example Request
cURL
curl -X POST https://api.marinahealth.eu/auth/login \
-H "Content-Type: application/json" \
-c cookies.txt \
-d '{
"email": "user@example.com",
"password": "securepassword"
}'Response
Successful
| Field | Type | Description |
|---|---|---|
| access_token | string | Short-lived JWT. Include as Bearer in Authorization header. |
| refresh_token | string | Opaque refresh token. Also set as an HttpOnly cookie. |
| token_type | string | Always "Bearer". |
| expires_in | number | Access token lifetime in seconds. |
| user | object | Authenticated user. |
| ↳id | string | UUID. |
| string | Email address. | |
| ↳role | string | User role. |
| ↳email_verified | boolean | Whether email is verified. |
json
{
"access_token": "eyJhbGciOiJIUzI1NiJ9...",
"refresh_token": "opaque_refresh_token",
"token_type": "Bearer",
"expires_in": 900,
"user": {
"id": "usr_abc123",
"email": "user@example.com",
"role": "user",
"email_verified": true
}
}