Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. UserAuthentication.php

function UserAuthentication::lookupAccount

Overrides UserAuthenticationInterface::lookupAccount

File

core/modules/user/src/UserAuthentication.php, line 62

Class

UserAuthentication
Validates user authentication credentials.

Namespace

Drupal\user

Code

public function lookupAccount($identifier) : UserInterface|false {
    if (!empty($identifier)) {
        $account_search = $this->entityTypeManager
            ->getStorage('user')
            ->loadByProperties([
            'name' => $identifier,
        ]);
        if ($account = reset($account_search)) {
            return $account;
        }
    }
    return FALSE;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal