unlink static method

Future<AuthResult> unlink(
  1. String provider
)

unlink current user with a social account

Implementation

static Future<AuthResult> unlink(String provider) async {
  Map map = {};
  map.putIfAbsent('provider', () => provider);
  if (currentUser != null) {
    map.putIfAbsent('primaryUserToken', () => currentUser!.token);
  }
  final Result result = await post('/api/v2/users/unlink', jsonEncode(map));
  AuthResult authResult = AuthResult(result);
  if (result.code == 200) {
    authResult.user = await createUser(result);
  }
  return authResult;
}