diff --git a/auth/oauth2/classes/auth.php b/auth/oauth2/classes/auth.php index b8023216fb1..c591d6528af 100644 --- a/auth/oauth2/classes/auth.php +++ b/auth/oauth2/classes/auth.php @@ -63,7 +63,6 @@ class auth extends \auth_plugin_base { public function __construct() { $this->authtype = 'oauth2'; $this->config = get_config('auth_oauth2'); - $this->customfields = $this->get_custom_user_profile_fields(); } /** @@ -310,7 +309,7 @@ class auth extends \auth_plugin_base { return $userdata; } - $allfields = array_merge($this->userfields, $this->customfields); + $allfields = array_merge($this->userfields, $this->get_custom_user_profile_fields()); // Go through each field from the external data. foreach ($externaldata as $fieldname => $value) {