You are here

protected function AuthController::insertAuth0User in Auth0 Single Sign On 8.2

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

Insert the Auth0 user.

Parameters

array $userInfo: The user info array.

int $uid: The Drupal user id.

Throws

\Exception

1 call to AuthController::insertAuth0User()
AuthController::processUserLogin in src/Controller/AuthController.php
Process the Auth0 user profile and sign in or sign the user up.

File

src/Controller/AuthController.php, line 930
Contains \Drupal\auth0\Controller\AuthController.

Class

AuthController
Controller routines for auth0 authentication.

Namespace

Drupal\auth0\Controller

Code

protected function insertAuth0User(array $userInfo, $uid) {
  db_insert('auth0_user')
    ->fields([
    'auth0_id' => $userInfo['user_id'],
    'drupal_id' => $uid,
    'auth0_object' => json_encode($userInfo),
  ])
    ->execute();
}