You are here

protected function AuthController::findAuth0User in Auth0 Single Sign On 8

Same name and namespace in other branches
  1. 8.2 src/Controller/AuthController.php \Drupal\auth0\Controller\AuthController::findAuth0User()

Get the auth0 user profile.

1 call to AuthController::findAuth0User()
AuthController::processUserLogin in src/Controller/AuthController.php
Process the auth0 user profile and signin or signup the user.

File

src/Controller/AuthController.php, line 426

Class

AuthController
Controller routines for auth0 authentication.

Namespace

Drupal\auth0\Controller

Code

protected function findAuth0User($id) {
  $auth0_user = db_select('auth0_user', 'a')
    ->fields('a', array(
    'drupal_id',
  ))
    ->condition('auth0_id', $id, '=')
    ->execute()
    ->fetchAssoc();
  return empty($auth0_user) ? FALSE : User::load($auth0_user['drupal_id']);
}