user_toolbar()
Implements hook_toolbar().
File
core/modules/user/user.module, line 1307 Enables the user registration and login system.
Code
function user_toolbar() {
$user = \Drupal::currentUser();
// Add logout & user account links or login link.
$links_cache_contexts = [];
if ($user->isAuthenticated()) {
$links = array(
'account' => array(
'title' => t('View profile'),
'url' => Url::fromRoute('user.page'),
'attributes' => array(