fix log in issue when incorrect password entered

This commit is contained in:
2024-07-29 16:44:23 +02:00
parent 88ca9b3f3c
commit 679a2a1a6f
2 changed files with 8 additions and 1 deletions

View File

@@ -144,6 +144,7 @@ class _RegisterState extends State<Register> {
// } // }
} }
} on AuthException catch (error) { } on AuthException catch (error) {
Navigator.of(context).pop();
loginError(error.message); loginError(error.message);
emailController.clear(); emailController.clear();
passwordController.clear(); passwordController.clear();

View File

@@ -59,21 +59,27 @@ class _SignInState extends State<SignIn> {
"Authorization": "leatucczyixqwkqqdrhayiwzeofkltds" "Authorization": "leatucczyixqwkqqdrhayiwzeofkltds"
}, },
); );
//print(response.body[])
if (response.statusCode == 200) { if (response.statusCode == 200) {
print(response.body);
var userSignedin = jsonDecode(response.body); var userSignedin = jsonDecode(response.body);
if (userSignedin["status"] == "OK") { if (userSignedin["status"] == "OK") {
print("here");
setState(() { setState(() {
successfulSignIn = true; successfulSignIn = true;
}); });
Navigator.of(context).pop();
} else { } else {
loginError(); Navigator.of(context).pop();
}
}
} on AuthException {
loginError(); loginError();
passwordController.clear(); passwordController.clear();
} }
}
} on AuthException {
Navigator.of(context).pop(); Navigator.of(context).pop();
loginError();
passwordController.clear();
}
} }
void loginError() { void loginError() {