WT1.1.2 build 32 login error messages fixes
This commit is contained in:
@@ -7,7 +7,7 @@ class UserRepository {
|
||||
User user;
|
||||
|
||||
UserRepository() {
|
||||
this.createNewUser();
|
||||
this.createNewUser();
|
||||
}
|
||||
|
||||
setEmail(String email) {
|
||||
@@ -24,10 +24,15 @@ class UserRepository {
|
||||
|
||||
Future<void> addUser() async {
|
||||
final User modelUser = this.user;
|
||||
String rc = await FirebaseApi().registerEmail(modelUser.email, modelUser.password);
|
||||
if ( rc == FirebaseApi.SIGN_IN_OK ) {
|
||||
modelUser.firebaseUid = Cache().firebaseUid;
|
||||
await CustomerApi().addUser(modelUser);
|
||||
try {
|
||||
String rc = await FirebaseApi().registerEmail(modelUser.email, modelUser.password);
|
||||
if (rc == FirebaseApi.SIGN_IN_OK) {
|
||||
modelUser.firebaseUid = Cache().firebaseUid;
|
||||
await CustomerApi().addUser(modelUser);
|
||||
}
|
||||
} catch (e) {
|
||||
print(e.toString());
|
||||
throw new Exception(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,12 +40,14 @@ class UserRepository {
|
||||
final User modelUser = this.user;
|
||||
String rc = await FirebaseApi().signInEmail(modelUser.email, modelUser.password);
|
||||
|
||||
if ( rc == FirebaseApi.SIGN_IN_OK ) {
|
||||
if (rc == FirebaseApi.SIGN_IN_OK) {
|
||||
print("Firebase login ok");
|
||||
await CustomerApi().getUserByEmail(modelUser.email);
|
||||
print("GetUserBy Email OK");
|
||||
Cache().afterFirebaseLogin();
|
||||
} else {
|
||||
throw Exception("Exception: Customer does not exist or the password is wrong");
|
||||
print("Exception: user not found or password is wrong");
|
||||
throw Exception("Customer does not exist or the password is wrong");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user