bindPhone static method

Future<AuthResult> bindPhone(
  1. String phone,
  2. String code
)

bind phone to current user.

Implementation

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