authUser method

Future<void> authUser(
  1. Session session,
  2. UserProfile userProfile,
  3. AuthUser authUser, {
  4. Transaction? transaction,
})

Creates a relation between the given UserProfile and AuthUser by setting the UserProfile's foreign key authUserId to refer to the AuthUser.

Implementation

Future<void> authUser(
  _i1.Session session,
  UserProfile userProfile,
  _i2.AuthUser authUser, {
  _i1.Transaction? transaction,
}) async {
  if (userProfile.id == null) {
    throw ArgumentError.notNull('userProfile.id');
  }
  if (authUser.id == null) {
    throw ArgumentError.notNull('authUser.id');
  }

  var $userProfile = userProfile.copyWith(authUserId: authUser.id);
  await session.db.updateRow<UserProfile>(
    $userProfile,
    columns: [UserProfile.t.authUserId],
    transaction: transaction,
  );
}