Aller au contenu

API d'Authentification

Chemin de base : /auth

Inscription

POST /auth/register
Content-Type: application/json

{
  "email": "user@example.com",
  "password": "password123",
  "name": "Alice"
}

Réponse

{ "access_token": "eyJ..." }

Connexion

POST /auth/login
Content-Type: application/json

{
  "email": "user@example.com",
  "password": "password123"
}

Rafraîchir le Jeton

POST /auth/refresh
Authorization: Bearer <token>

Obtenir l'Utilisateur Actuel

GET /auth/me
Authorization: Bearer <token>

Réponse

{
  "id": "1",
  "email": "user@example.com",
  "name": "Alice"
}