linkExistingUserWithCredentials method

  1. @override
Future<User?> linkExistingUserWithCredentials(
  1. String provider,
  2. List<String> scopes, [
  3. Map<String, String>? customOAuthParameters
])
override

Starts a OAuth sign-in flow for provider using Firebase. The instance of FirebaseAuth will be from the default Firebase App Unless withApp is used to build an instance. The credentials will be added to the existing Firebase User An error will be throw if there's no Firebase User

Implementation

@override
Future<User?> linkExistingUserWithCredentials(
    String provider, List<String> scopes,
    [Map<String, String>? customOAuthParameters]) async {
  await _channel.invokeMethod("linkWithOAuth", {
    'provider': provider,
    'app': _app.name,
    'scopes': json.encode(scopes),
    if (customOAuthParameters != null)
      'parameters': json.encode(customOAuthParameters)
  });
  return FirebaseAuth.instanceFor(app: _app).currentUser;
}