diff --git a/src/Commands/core/LoginCommands.php b/src/Commands/core/LoginCommands.php index 887bf87400..04c34ed513 100644 --- a/src/Commands/core/LoginCommands.php +++ b/src/Commands/core/LoginCommands.php @@ -69,6 +69,10 @@ public function login($path = '', $options = ['name' => null, 'uid' => null, 'ma $account = User::load(1); } + if ($account->isBlocked()) { + throw new \InvalidArgumentException(dt('Account !name is blocked and thus cannot login. The user:unblock command may be helpful.')); + } + $timestamp = \Drupal::time()->getRequestTime(); $link = Url::fromRoute( 'user.reset.login',