Implémentation complète du ticket #47 : - Mise à jour de l'URL API vers app.ptits-pas.fr - Ajout du champ changement_mdp_obligatoire au modèle AppUser - Ajout des endpoints /auth/me et /auth/change-password-required - Implémentation de la vraie logique de connexion dans AuthService - Création de la modale ChangePasswordDialog non-dismissible - Connexion du bouton de connexion avec gestion de la modale - Ajout des routes admin-dashboard et parent-dashboard La modale s'affiche automatiquement après connexion si changement_mdp_obligatoire = true et bloque l'utilisateur jusqu'au changement de mot de passe.
34 lines
1.1 KiB
Dart
34 lines
1.1 KiB
Dart
class ApiConfig {
|
|
// static const String baseUrl = 'http://localhost:3000/api/v1/';
|
|
static const String baseUrl = 'https://app.ptits-pas.fr/api/v1';
|
|
|
|
// Auth endpoints
|
|
static const String login = '/auth/login';
|
|
static const String register = '/auth/register';
|
|
static const String refreshToken = '/auth/refresh';
|
|
static const String authMe = '/auth/me';
|
|
static const String changePasswordRequired = '/auth/change-password-required';
|
|
|
|
// Users endpoints
|
|
static const String users = '/users';
|
|
static const String userProfile = '/users/profile';
|
|
static const String userChildren = '/users/children';
|
|
|
|
// Dashboard endpoints
|
|
static const String dashboard = '/dashboard';
|
|
static const String events = '/events';
|
|
static const String contracts = '/contracts';
|
|
static const String conversations = '/conversations';
|
|
static const String notifications = '/notifications';
|
|
|
|
// Headers
|
|
static Map<String, String> get headers => {
|
|
'Content-Type': 'application/json',
|
|
'Accept': 'application/json',
|
|
};
|
|
|
|
static Map<String, String> authHeaders(String token) => {
|
|
...headers,
|
|
'Authorization': 'Bearer $token',
|
|
};
|
|
} |