diff --git a/apps/packages/features/client/authentication/lib/src/data/repositories_impl/auth_repository_impl.dart b/apps/packages/features/client/authentication/lib/src/data/repositories_impl/auth_repository_impl.dart index 9df42375..ede79873 100644 --- a/apps/packages/features/client/authentication/lib/src/data/repositories_impl/auth_repository_impl.dart +++ b/apps/packages/features/client/authentication/lib/src/data/repositories_impl/auth_repository_impl.dart @@ -39,8 +39,10 @@ class AuthRepositoryImpl implements AuthRepositoryInterface { fallbackEmail: firebaseUser.email ?? email, ); + //TO-DO: validate that user is business role and has business account + } on firebase.FirebaseAuthException catch (e) { - if (e.code == 'user-not-found' || e.code == 'wrong-password') { + if (e.code == 'invalid-credential' || e.code == 'wrong-password') { throw Exception('Incorrect email or password.'); } else { throw Exception('Authentication error: ${e.message}'); @@ -94,7 +96,7 @@ class AuthRepositoryImpl implements AuthRepositoryInterface { final newUserData = createUserResponse.data?.user_insert; if (newUserData == null) { await firebaseUser.delete(); // Rollback if user profile creation fails - // TODO: Also delete the created Business if this fails + // TO-DO: Also delete the created Business if this fails throw Exception('User profile creation failed after Firebase user registration.'); }