forked from yaso_meth/mih-project
fix log in issue when incorrect password entered
This commit is contained in:
@@ -144,6 +144,7 @@ class _RegisterState extends State<Register> {
|
||||
// }
|
||||
}
|
||||
} on AuthException catch (error) {
|
||||
Navigator.of(context).pop();
|
||||
loginError(error.message);
|
||||
emailController.clear();
|
||||
passwordController.clear();
|
||||
|
||||
@@ -59,21 +59,27 @@ class _SignInState extends State<SignIn> {
|
||||
"Authorization": "leatucczyixqwkqqdrhayiwzeofkltds"
|
||||
},
|
||||
);
|
||||
//print(response.body[])
|
||||
if (response.statusCode == 200) {
|
||||
print(response.body);
|
||||
var userSignedin = jsonDecode(response.body);
|
||||
if (userSignedin["status"] == "OK") {
|
||||
print("here");
|
||||
setState(() {
|
||||
successfulSignIn = true;
|
||||
});
|
||||
Navigator.of(context).pop();
|
||||
} else {
|
||||
Navigator.of(context).pop();
|
||||
loginError();
|
||||
passwordController.clear();
|
||||
}
|
||||
}
|
||||
} on AuthException {
|
||||
Navigator.of(context).pop();
|
||||
loginError();
|
||||
passwordController.clear();
|
||||
}
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
|
||||
void loginError() {
|
||||
|
||||
Reference in New Issue
Block a user