bindEmail static method

Future<AuthResult> bindEmail(
  1. String email,
  2. String code
)

bind email to current user.

Implementation

static Future<AuthResult> bindEmail(String email, String code) async {
  var body = jsonEncode({'email': email, 'emailCode': code});
  final Result result = await post('/api/v2/users/email/bind', body);
  AuthResult authResult = AuthResult(result);
  if (result.code == 200) {
    authResult.user = await createUser(result);
  }
  return authResult;
}