unblockUser static method

Future<void> unblockUser(
  1. Session session,
  2. int userId
)

Unblocks a user so that they can log in again.

Implementation

static Future<void> unblockUser(
  Session session,
  int userId,
) async {
  var userInfo = await findUserByUserId(session, userId);
  if (userInfo == null) {
    throw 'userId $userId not found';
  } else if (!userInfo.blocked) {
    throw 'userId $userId already unblocked';
  }
  userInfo.blocked = false;
  await session.db.updateRow(userInfo);
}