linkMicrosoftAuthentication method

Future<MicrosoftAccount> linkMicrosoftAuthentication(
  1. Session session, {
  2. required UuidValue authUserId,
  3. required MicrosoftAccountDetails accountDetails,
  4. Transaction? transaction,
})

Adds a Microsoft authentication to the given authUserId.

Returns the newly created Microsoft account.

The transaction parameter can be used to perform the database operations within an existing transaction.

Implementation

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