addClient method

Future addClient(
  1. AuthClient client
)

Adds an OAuth2 client.

delegate will store this client for future use.

Implementation

Future addClient(AuthClient client) async {
  if (client.id.isEmpty) {
    throw ArgumentError(
      "A client must have an id.",
    );
  }

  if (client.redirectURI != null && client.hashedSecret == null) {
    throw ArgumentError(
      "A client with a redirectURI must have a client secret.",
    );
  }

  return delegate.addClient(this, client);
}