$app_name, 'redirect_uris' => $redirect_uris, 'website' => $site_name, 'scopes' => $scopes, ])); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); curl_close($ch); # result must be JSON $result = @json_decode($result); if ($result === null) { hres_json(500, ERR, lr('error.instance_failed_or_not_mastodon', 'Instance failed to create an authorization App. Is it an instance?')); } # return authentication data hres_json(200, OK, [ 'instance' => $instance, 'result' => $result, 'response_type' => 'code', 'scope' => $scopes ]);