authenticateCustom method
Authenticate custom OAuth credentials on backend
Implementation
Future<CkAuthResult<TProfile>> authenticateCustom({
required String providerName,
required Map<String, dynamic> authData,
}) async {
if (_config?.customProviders == null) {
return CkAuthResult<TProfile>.failure(
message: 'No custom social providers configured',
);
}
final cConfig = _config!.customProviders!.firstWhere(
(p) => p.providerName == providerName,
orElse: () =>
throw ArgumentError('Provider $providerName not configured'),
);
final body = cConfig.bodyBuilder(authData);
final extractors =
cConfig.responseExtractors ?? _defaultExtractors;
return _executeSocialRequest(
url: cConfig.backendUrl,
method: cConfig.method,
body: body,
extractors: extractors,
);
}