startSignin static method

Future<void> startSignin({
  1. required GoogleAuthSetup setup,
})

Implementation

static Future<void> startSignin({required GoogleAuthSetup setup}) async {
  final secParams = AuthReqSecParamsGen.genAuthReqSecParams();
  html.window.localStorage['code_verifier'] = secParams.codeVerifier;

  final authorizationRequestUri = GoogleAuthUrl.getGoogleAuthUrl(
    parameters: GoogleAuthUrlParameters(
      clientId: setup.clientId,
      redirectUri: setup.redirectUri,
      responseType: "code",
      scopes: setup.scopes,
      codeChallenge: secParams.codeChallange,
      codeChallengeMethod: "S256",
      state: secParams.state,
    ),
  );
  html.window.location.href = authorizationRequestUri;
}