authenticateGoogle method

Future<CkAuthResult<TProfile>> authenticateGoogle(
  1. CkGoogleAuthData data
)

Authenticate Google credentials on backend

Implementation

Future<CkAuthResult<TProfile>> authenticateGoogle(
  CkGoogleAuthData data,
) async {
  if (_config?.google == null) {
    return CkAuthResult<TProfile>.failure(
      message: 'Google auth is not configured',
    );
  }

  final gConfig = _config!.google!;
  final body = gConfig.bodyBuilder(data);
  final extractors =
      gConfig.responseExtractors ?? _defaultExtractors;

  return _executeSocialRequest(
    url: gConfig.backendUrl,
    method: gConfig.method,
    body: body,
    extractors: extractors,
  );
}