restoreGrant function

AuthorizationCodeGrant restoreGrant(
  1. Config config, {
  2. required String state,
  3. String? codeVerifier,
  4. Client? httpClient,
})

Creates an authorization code grant and advances the internal state to pendingResponse so that parameter exchange will work.

Implementation

oauth2.AuthorizationCodeGrant restoreGrant(
  Config config, {
  required String state,
  String? codeVerifier,
  http.Client? httpClient,
}) {
  final grant = createGrant(
    config,
    codeVerifier: codeVerifier,
    httpClient: httpClient,
  );

  // Advances the internal state.
  grant.getAuthorizationUrl(
    config.redirectUri,
    scopes: config.scopes,
    state: state,
  );
  return grant;
}