From 0cd9ed114ecd3ef41540c1cb05f5e912c5656914 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Fri, 24 Mar 2017 14:14:56 +0000 Subject: [PATCH] Remove refresh syndication targets specific code --- .../Controllers/MicropubClientController.php | 38 ------------------- routes/web.php | 1 - 2 files changed, 39 deletions(-) diff --git a/app/Http/Controllers/MicropubClientController.php b/app/Http/Controllers/MicropubClientController.php index ca38e204..bdeede26 100644 --- a/app/Http/Controllers/MicropubClientController.php +++ b/app/Http/Controllers/MicropubClientController.php @@ -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. * diff --git a/routes/web.php b/routes/web.php index 364f31a9..5d9c572d 100644 --- a/routes/web.php +++ b/routes/web.php @@ -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');