I have a flutter app.
Appwrite version for the flutter client - appwrite client: 12.0.3, on the self-hosted server - Version 1.5.7.
When trying to log in with an error on an android device (for example, an invalid password), the error is returned, but if I want to get an error when logging in via an iOS device, the code freezes in the place that I indicated. Please help me
Future<Session> createEmailSession(
{required String email, required String password}) async {
notifyListeners();
try {
//this line is stuck
final session = await account.createEmailPasswordSession(
email: email, password: password);
//end
_currentUser = await account.get();
_status = AuthStatus.authenticated;
return session;
} finally {
notifyListeners();
}
}
And here is the code that handles the exception:
Future<void> signIn() async {
if (loading) {
return;
}
setState(() {
loading = true;
});
await showLoadingDialog();
try {
//here
await user.createEmailSession(
email: emailTextController.text,
password: passwordTextController.text,
);
//end
showSnackbar('Success login');
context.pushReplacement('/');
} on AppwriteException catch (e) {
showAlert('Error', e.message.toString());
} finally {
Navigator.pop(context);
setState(() {
loading = false;
});
}
}
Recommended threads
- Send Email Verification With REST
I am using REST to create a user on the server side after receiving form data from the client. After the account is successfully created i wanted to send the v...
- Use different email hosts for different ...
Hello, I have 2 projects and i want to be able to set up email templates in the projects. Both projects will have different email host configurations. I see ...
- Migrate from cloud to localhost
Hello everyone. I need to migrate my test project from cloud to localhost, however it seems that this is possible only if a self-hosted appwrite instance it's h...