linkGoogleAuthentication method

Future<GoogleAccount> linkGoogleAuthentication(
  1. Session session, {
  2. required UuidValue authUserId,
  3. required GoogleAccountDetails accountDetails,
  4. Transaction? transaction,
})

Adds a Google authentication to the given authUserId.

Returns the newly created Google account.

Implementation

Future<GoogleAccount> linkGoogleAuthentication(
  final Session session, {
  required final UuidValue authUserId,
  required final GoogleAccountDetails accountDetails,
  final Transaction? transaction,
}) async {
  return await GoogleAccount.db.insertRow(
    session,
    GoogleAccount(
      userIdentifier: accountDetails.userIdentifier,
      email: accountDetails.email.toLowerCase(),
      authUserId: authUserId,
    ),
    transaction: transaction,
  );
}