You are here

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

Update the Auth fields.

Parameters

array $userInfo: The user info array.

\Drupal\user\Entity\User $user: The Drupal user entity.

2 calls to AuthController::auth0UpdateFieldsAndRoles()
AuthController::processUserLogin in src/Controller/AuthController.php
Process the Auth0 user profile and sign in or sign the user up.
AuthController::signupUser in src/Controller/AuthController.php
Create or link a new user based on the auth0 profile.

File

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

Class

AuthController
Controller routines for auth0 authentication.

Namespace

Drupal\auth0\Controller

Code

protected function auth0UpdateFieldsAndRoles(array $userInfo, User $user) {
  $edit = [];
  $this
    ->auth0UpdateFields($userInfo, $user, $edit);
  $this
    ->auth0UpdateRoles($userInfo, $user, $edit);
  $user
    ->save();
}