-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
完成微软账户登录后发生服务器错误:Undefined array key "access_token"
对应的URL是:https:///mojang/callback?code=&state=***
debug模式下显示的对应代码位置
// Authenticate with Minecraft
$response = Http::post('https://api.minecraftservices.com/authentication/login_with_xbox', [
'identityToken' => 'XBL3.0 x='.$user_hash.';'.$xsts_token,
])->json();
if (Arr::exists($response, 'error')) {
// UNAUTHORIZED
Log::channel('mojang-verification')->info("User [$user->email] authenticate with Minecraft failed.", compact('response'));
abort(500);
}
=> $minecraft_access_token = $response['access_token'];
// Get the profile
$response = Http::withToken($minecraft_access_token)->get('https://api.minecraftservices.com/minecraft/profile')->json();
if (Arr::exists($response, 'error')) {
// logger($response);
// NOT_FOUND
// CONSTRAINT_VIOLATION
Log::channel('mojang-verification')->info("User [$user->email] get the profile failed.", compact('response'));
abort(403, trans('GPlane\Mojang::bind.failed.not-purchased'));
}
return $response;
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels