fix log in issue when incorrect password entered
This commit is contained in:
parent
88ca9b3f3c
commit
679a2a1a6f
2 changed files with 8 additions and 1 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue