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

NameTypeRequiredDescription
emailstringrequiredRegistered email address.
passwordstringrequiredAccount 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
FieldTypeDescription
access_tokenstringShort-lived JWT. Include as Bearer in Authorization header.
refresh_tokenstringOpaque refresh token. Also set as an HttpOnly cookie.
token_typestringAlways "Bearer".
expires_innumberAccess token lifetime in seconds.
userobjectAuthenticated user.
idstringUUID.
emailstringEmail address.
rolestringUser role.
email_verifiedbooleanWhether 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
  }
}