Skip to content

Commit

Permalink
oauth2 login bug
Browse files Browse the repository at this point in the history
  • Loading branch information
star7th committed Feb 19, 2022
1 parent a46999f commit 5d3ec69
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion server/Application/Api/Controller/ExtLoginController.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,16 @@ public function oauth2(){

$res_array = json_decode($res, true);
if($res_array){
$username = $res_array['preferred_username'] ? $res_array['preferred_username'] : $res_array['username'] ;
$username = '';
if($res_array['preferred_username']){
$username = $res_array['preferred_username'] ;
}
if($res_array['name']){
$username = $res_array['name'] ;
}
if($res_array['username']){
$username = $res_array['username'] ;
}
if(!$username){
echo "返回信息中无法获取用户名。返回的内容如下:".$res;
return ;
Expand Down

0 comments on commit 5d3ec69

Please sign in to comment.