You are here

public function Oauth2Client::updateUserMetadata in Auth0 Single Sign On 8.2

Updates the user metadata. This end up calling the path /users/{id_user} To delete an attribute, just set it null. ie: [ 'old_attr' => null ] It will only update the existing attrs and keep the others untouched

Parameters

array $metadata:

Throws

ApiException

See also

https://auth0.com/docs/apiv2#!/users/patch_users_by_id

File

vendor/auth0/auth0-php/src/API/Oauth2Client.php, line 350

Class

Oauth2Client
This class provides access to Auth0 Platform.

Namespace

Auth0\SDK\API

Code

public function updateUserMetadata($metadata) {
  $auth0Api = new Auth0Api($this
    ->getIdToken(), $this->domain);
  $user = $auth0Api->users
    ->update($this->user['user_id'], [
    'user_metadata' => $metadata,
  ]);
  $this
    ->setUser($user);
}