Hi! I’m trying to login to server with already created user. But response always returns false
.
Here is my init code:
void main() async {
await Parse().initialize(
PARSE_APP_ID,
PARSE_APP_URL,
clientKey: CLIENT_KEY,
// debug: true,
autoSendSessionId: true,
coreStore: await CoreStoreSharedPrefsImp.getInstance());
setupServiceLocator();
runApp(MyApp());
}
here is my login method:
Future<ParseUser> signIn({String email, String password}) async {
ParseUser user = ParseUser(email, password, email);
print('method signIn, user is: $user');
ParseResponse response = await user.login();
print('auth_service_parse.dart, method signIn, response is: ${response.error}');
if (response.success) {
print('user logged in with id: ${user.objectId}');
return user;
} else {
print('user logging in error: ${response.error.message}');
}
print('user sign in is null');
return null;
// String url = 'http://...:1337/parse/login';
// var body = json.encode({'username': email, 'password': password, 'email': email});
// var response = await http.post(
// url,
// headers: {
// 'Content-Type': 'application/json',
// 'X-Parse-Application-Id': 'appId',
// 'X-Parse-REST-API-Key': 'masterKey'
// },
// body: body
// );
//
// print(response.body);
}
if I’m using REST API instead of SDK method, the everything is OK, and response returns info about user.
How can I fix this?
Thanks!
And this question already asked on GitHub, but still have no result.
Hope to get some help here )
Thanks!