function ServerCommand::getOneTimeLoginUrl

Same name in other branches
  1. 9 core/lib/Drupal/Core/Command/ServerCommand.php \Drupal\Core\Command\ServerCommand::getOneTimeLoginUrl()
  2. 10 core/lib/Drupal/Core/Command/ServerCommand.php \Drupal\Core\Command\ServerCommand::getOneTimeLoginUrl()
  3. 11.x core/lib/Drupal/Core/Command/ServerCommand.php \Drupal\Core\Command\ServerCommand::getOneTimeLoginUrl()

Gets a one time login URL for user 1.

Return value

string The one time login URL for user 1.

File

core/lib/Drupal/Core/Command/ServerCommand.php, line 187

Class

ServerCommand
Runs the PHP webserver for a Drupal site for local testing/development.

Namespace

Drupal\Core\Command

Code

protected function getOneTimeLoginUrl() {
    $user = User::load(1);
    \Drupal::moduleHandler()->load('user');
    return user_pass_reset_url($user);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.