I think this will pass
This commit is contained in:
parent
ae9ed10f65
commit
70d17006dd
1 changed files with 1 additions and 6 deletions
|
@ -95,7 +95,6 @@ class MicropubClientController extends Controller
|
||||||
$token = $request->session()->get('token');
|
$token = $request->session()->get('token');
|
||||||
$micropubEndpoint = $this->indieAuthService->discoverMicropubEndpoint($domain, $this->indieClient);
|
$micropubEndpoint = $this->indieAuthService->discoverMicropubEndpoint($domain, $this->indieClient);
|
||||||
if (! $micropubEndpoint) {
|
if (! $micropubEndpoint) {
|
||||||
die('No known endpoint');
|
|
||||||
return redirect(route('micropub-client'))->withErrors('Unable to determine micropub API endpoint', 'endpoint');
|
return redirect(route('micropub-client'))->withErrors('Unable to determine micropub API endpoint', 'endpoint');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,12 +104,10 @@ class MicropubClientController extends Controller
|
||||||
'query' => ['q' => 'syndicate-to'],
|
'query' => ['q' => 'syndicate-to'],
|
||||||
]);
|
]);
|
||||||
} catch (\GuzzleHttp\Exception\BadResponseException $e) {
|
} catch (\GuzzleHttp\Exception\BadResponseException $e) {
|
||||||
dd($e);
|
|
||||||
return redirect(route('micropub-client'))->withErrors('Bad response when refreshing syndication targets', 'endpoint');
|
return redirect(route('micropub-client'))->withErrors('Bad response when refreshing syndication targets', 'endpoint');
|
||||||
}
|
}
|
||||||
$body = (string) $response->getBody();
|
$body = (string) $response->getBody();
|
||||||
$syndication = $this->parseSyndicationTargets($body);
|
$syndication = $this->parseSyndicationTargets($body);
|
||||||
dd($syndication);
|
|
||||||
|
|
||||||
$request->session()->put('syndication', $syndication);
|
$request->session()->put('syndication', $syndication);
|
||||||
|
|
||||||
|
@ -325,9 +322,7 @@ class MicropubClientController extends Controller
|
||||||
private function parseSyndicationTargets($syndicationTargets = null)
|
private function parseSyndicationTargets($syndicationTargets = null)
|
||||||
{
|
{
|
||||||
if ($syndicationTargets === null) {
|
if ($syndicationTargets === null) {
|
||||||
return [
|
return;
|
||||||
['target' => 'http://example.org', 'name' => 'Joe Bloggs on Example']
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
$syndicateTo = [];
|
$syndicateTo = [];
|
||||||
$data = json_decode($syndicationTargets, true);
|
$data = json_decode($syndicationTargets, true);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue