From 979d1f66dd1e15f64e941525c299bf7a272eb2e2 Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Wed, 15 Mar 2017 10:13:07 +0800 Subject: [PATCH] MDL-58220 auth_oauth2: Fix new account creation This was not allowing new accounts to be registered. --- auth/oauth2/classes/auth.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/auth/oauth2/classes/auth.php b/auth/oauth2/classes/auth.php index 832d1f0398b..b2fa8f6626e 100644 --- a/auth/oauth2/classes/auth.php +++ b/auth/oauth2/classes/auth.php @@ -76,6 +76,7 @@ class auth extends \auth_plugin_base { if ($verifyusername == $username) { return true; } + return false; } /** @@ -369,7 +370,7 @@ class auth extends \auth_plugin_base { $this->set_static_user_info($userinfo); - $user = get_complete_user_data('username', $userinfo['username']); + $user = authenticate_user_login($userinfo['username'], ''); if ($user) { complete_user_login($user);