From beb3a36590769733df8307a9ac8a855f5db7e0f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Salazar?= <73718835+joshrs23@users.noreply.github.com> Date: Thu, 22 Jan 2026 09:46:39 -0500 Subject: [PATCH] getting message of throw with invalid data --- .../src/data/repositories_impl/auth_repository_impl.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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.'); }