linkAccount method

Future<Map<String, dynamic>> linkAccount(
  1. String provider,
  2. String credential
)

Link an additional provider credential to the current (anonymous or identified) account. NEW in 4.0.

Returns the resulting AuthResult (the upgraded user). For social providers, credential is the identity / id token; for email/password, the server-defined credential shape applies.

Implementation

Future<Map<String, dynamic>> linkAccount(
    String provider, String credential) async {
  final result =
      _expectJson(_bindings.authLinkAccount(provider, credential));
  _notifyAuthState(_sessionFromAuthResult(result));
  return result;
}