v1.1.27 deactivate customer

This commit is contained in:
Tibor Bossanyi (Freelancer)
2022-11-26 16:46:06 +01:00
parent dbdcf2f239
commit 98901f2770
10 changed files with 116 additions and 9 deletions
+9 -6
View File
@@ -204,12 +204,15 @@ class UserRepository with Logging {
Future<void> getUser() async {
final User modelUser = this.user;
String rc = await FirebaseApi().signInEmail(modelUser.email, modelUser.password);
if (rc == FirebaseApi.SIGN_IN_OK) {
await CustomerApi().getUserByEmail(modelUser.email!);
await Cache().afterFirebaseLogin();
} else {
log("Exception: user not found or password is wrong");
try {
if (rc == FirebaseApi.SIGN_IN_OK) {
await CustomerApi().getUserByEmail(modelUser.email!);
await Cache().afterFirebaseLogin();
} else {
log("Exception: user not found or password is wrong");
throw Exception("Customer does not exist or the password is wrong");
}
} on NotFoundException catch (_) {
throw Exception("Customer does not exist or the password is wrong");
}
}