From 9965fb9df7f305f3306bf1d9b2f71b195cffda05 Mon Sep 17 00:00:00 2001 From: star7th Date: Thu, 23 Sep 2021 16:30:36 +0800 Subject: [PATCH] Update ExtLoginController.class.php --- server/Application/Api/Controller/ExtLoginController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Application/Api/Controller/ExtLoginController.class.php b/server/Application/Api/Controller/ExtLoginController.class.php index 0bbb91190..1269e1b1d 100644 --- a/server/Application/Api/Controller/ExtLoginController.class.php +++ b/server/Application/Api/Controller/ExtLoginController.class.php @@ -135,7 +135,7 @@ public function oauth2(){ )); $res_array = json_decode($res, true); if($res_array){ - $username = $res_array['username'] ; + $username = $res_array['preferred_username'] ? $res_array['preferred_username'] : $res_array['username'] ; $info = D("User")->where("username='%s'" ,array($username))->find(); if(!$info){ D("User")->register($username,md5($username.time().rand()));