diff --git a/src/Commands/core/LoginCommands.php b/src/Commands/core/LoginCommands.php index 887bf87400..3db35557ba 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.', ['!name' => $account->getAccountName()])); + } + $timestamp = \Drupal::time()->getRequestTime(); $link = Url::fromRoute( 'user.reset.login',