unblockUser static method
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);
}