signInWithGoogle method

Future<KoolbaseUser> signInWithGoogle({
  1. required String idToken,
  2. String? nonce,
})

Sign in with Google using an idToken obtained from a native Google Sign-In SDK.

The SDK is library-agnostic — use any native Google Sign-In package (google_sign_in, etc.) and pass the resulting idToken. Google embeds the user's name and email in the idToken itself, so this method does not take a fullName parameter (unlike signInWithApple).

On success the session is persisted via KoolbaseAuthStorage and authStateChanges fires with the resolved user.

Throws:

Implementation

Future<KoolbaseUser> signInWithGoogle({
  required String idToken,
  String? nonce,
}) async {
  final session = await _api.signInWithGoogle(
    idToken: idToken,
    nonce: nonce,
  );
  await _setSession(session);
  return session.user;
}