protected function ServerCommand::getOneTimeLoginUrl in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Command/ServerCommand.php \Drupal\Core\Command\ServerCommand::getOneTimeLoginUrl()
- 10 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\CommandCode
protected function getOneTimeLoginUrl() {
$user = User::load(1);
\Drupal::moduleHandler()
->load('user');
return user_pass_reset_url($user);
}