loginByEmail static method
login by email and password.
Implementation
static Future<AuthResult> loginByEmail(String email, String password,
[LoginOptions? options]) async {
var body = {
'connection': 'PASSWORD',
'passwordPayload': {
'email': email,
'password':
Util.encrypt(password, encryptType: options?.passwordEncryptType)
},
};
var jsonBody = jsonEncode(body);
if (options != null) {
jsonBody = jsonEncode(options.setValues(body));
}
final Result result = await post('/api/v3/signin', jsonBody);
AuthResult authResult = AuthResult(result);
authResult.user = await createUser(result);
return authResult;
}