loginWithCode method
Validates a Google authorization code from the web OAuth2 PKCE flow and either logs in the associated user or creates a new account.
This is the web counterpart of login, which accepts an ID token directly
(used on native platforms via the google_sign_in package).
If a new user is created an associated UserProfile is also created.
Implementation
Future<AuthSuccess> loginWithCode(
final Session session, {
required final String code,
required final String codeVerifier,
required final String redirectUri,
final Transaction? transaction,
}) async {
final tokens = await utils.exchangeCodeForToken(
session,
code: code,
codeVerifier: codeVerifier,
redirectUri: redirectUri,
);
return login(
session,
idToken: tokens.idToken,
accessToken: tokens.accessToken,
transaction: transaction,
);
}