Enhance Google and Apple sign-up methods to include name and firstname parameters
This commit is contained in:
@@ -116,7 +116,11 @@ class AuthRepository {
|
||||
///
|
||||
/// Returns the [User] model if successful, null if Google sign-in was cancelled.
|
||||
/// Throws an exception if authentication fails.
|
||||
Future<User?> signUpWithGoogle(String phoneNumber) async {
|
||||
Future<User?> signUpWithGoogle(
|
||||
String phoneNumber,
|
||||
String name,
|
||||
String firstname,
|
||||
) async {
|
||||
try {
|
||||
final firebaseUser = await _authService.signInWithGoogle();
|
||||
|
||||
@@ -132,8 +136,8 @@ class AuthRepository {
|
||||
final user = User(
|
||||
id: firebaseUser.user!.uid,
|
||||
email: firebaseUser.user!.email ?? '',
|
||||
nom: '',
|
||||
prenom: firebaseUser.user!.displayName ?? 'User',
|
||||
nom: name,
|
||||
prenom: firstname,
|
||||
phoneNumber: phoneNumber,
|
||||
profilePictureUrl: firebaseUser.user!.photoURL ?? 'Unknown',
|
||||
platform: 'google',
|
||||
@@ -171,7 +175,11 @@ class AuthRepository {
|
||||
///
|
||||
/// Returns the [User] model if successful, null if Apple sign-in was cancelled.
|
||||
/// Throws an exception if authentication fails.
|
||||
Future<User?> signUpWithApple(String phoneNumber) async {
|
||||
Future<User?> signUpWithApple(
|
||||
String phoneNumber,
|
||||
String name,
|
||||
String firstname,
|
||||
) async {
|
||||
try {
|
||||
final firebaseUser = await _authService.signInWithApple();
|
||||
|
||||
@@ -185,8 +193,8 @@ class AuthRepository {
|
||||
final user = User(
|
||||
id: firebaseUser.user!.uid,
|
||||
email: firebaseUser.user!.email ?? '',
|
||||
nom: '',
|
||||
prenom: firebaseUser.user!.displayName ?? 'User',
|
||||
nom: name,
|
||||
prenom: firstname,
|
||||
phoneNumber: phoneNumber,
|
||||
profilePictureUrl: firebaseUser.user!.photoURL ?? 'Unknown',
|
||||
platform: 'apple',
|
||||
|
||||
Reference in New Issue
Block a user