link static method

Future<AuthResult> link(
  1. String primaryUserToken,
  2. String secondaryUserToken
)

link current user with a social account

Implementation

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