Enhance user authentication handling by adding authMethod to UserModel and updating ProfileContent to display authentication method details.
This commit is contained in:
@@ -72,15 +72,19 @@ class UserModel {
|
||||
/// User's last name (optional).
|
||||
final String? nom;
|
||||
|
||||
/// Platform used for authentication (e.g., 'google', 'apple', 'email').
|
||||
final String? authMethod;
|
||||
|
||||
/// Creates a new [UserModel] instance.
|
||||
///
|
||||
/// [id], [email], and [prenom] are required fields.
|
||||
/// [nom] is optional and can be null.
|
||||
/// [nom] and [authMethod] are optional and can be null.
|
||||
UserModel({
|
||||
required this.id,
|
||||
required this.email,
|
||||
required this.prenom,
|
||||
this.nom,
|
||||
this.authMethod,
|
||||
});
|
||||
|
||||
/// Creates a [UserModel] instance from a JSON map.
|
||||
@@ -93,6 +97,7 @@ class UserModel {
|
||||
email: json['email'] ?? '',
|
||||
prenom: json['prenom'] ?? 'Voyageur',
|
||||
nom: json['nom'],
|
||||
authMethod: json['authMethod'] ?? json['platform'],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -105,6 +110,7 @@ class UserModel {
|
||||
'email': email,
|
||||
'prenom': prenom,
|
||||
'nom': nom,
|
||||
'authMethod': authMethod,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user