Remove refresh syndication targets specific code
This commit is contained in:
parent
ec4299c590
commit
0cd9ed114e
2 changed files with 0 additions and 39 deletions
|
@ -183,44 +183,6 @@ class MicropubClientController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* We make a request to the micropub endpoint requesting syndication targets
|
||||
* and store them in the session.
|
||||
*
|
||||
* @todo better handling of response regarding mp-syndicate-to
|
||||
* and syndicate-to
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Routing\Redirector redirect
|
||||
*/
|
||||
public function refreshSyndicationTargets(Request $request)
|
||||
{
|
||||
$domain = $request->session()->get('me');
|
||||
$token = $request->session()->get('token');
|
||||
$micropubEndpoint = $this->indieAuthService->discoverMicropubEndpoint($domain, $this->indieClient);
|
||||
if (! $micropubEndpoint) {
|
||||
return redirect(route('micropub-client'))->with('error', 'Unable to determine micropub API endpoint');
|
||||
}
|
||||
|
||||
try {
|
||||
$response = $this->guzzleClient->get($micropubEndpoint, [
|
||||
'headers' => ['Authorization' => 'Bearer ' . $token],
|
||||
'query' => ['q' => 'syndicate-to'],
|
||||
]);
|
||||
} catch (\GuzzleHttp\Exception\BadResponseException $e) {
|
||||
return redirect(route('micropub-client'))->with(
|
||||
'error',
|
||||
'Bad response when refreshing syndication targets'
|
||||
);
|
||||
}
|
||||
$body = (string) $response->getBody();
|
||||
$syndication = $this->parseSyndicationTargets($body);
|
||||
|
||||
$request->session()->put('syndication', $syndication);
|
||||
|
||||
return redirect(route('micropub-client'));
|
||||
}
|
||||
|
||||
/**
|
||||
* This method performs the actual POST request.
|
||||
*
|
||||
|
|
|
@ -110,7 +110,6 @@ Route::group(['domain' => config('url.longurl')], function () {
|
|||
Route::post('micropub', 'MicropubClientController@store')->name('micropub-client-post');
|
||||
Route::get('micropub/config', 'MicropubClientController@config')->name('micropub-config');
|
||||
Route::get('micropub/query-endpoint', 'MicropubClientController@queryEndpoint')->name('micropub-query-action');
|
||||
//Route::get('micropub/refresh-syndication-targets', 'MicropubClientController@refreshSyndicationTargets');
|
||||
Route::get('micropub/places', 'MicropubClientController@nearbyPlaces');
|
||||
Route::post('micropub/places', 'MicropubClientController@newPlace');
|
||||
Route::post('micropub/media', 'MicropubClientController@processMedia')->name('process-media');
|
||||
|
|
Loading…
Add table
Reference in a new issue