diff --git a/app/Http/Controllers/MicropubClientController.php b/app/Http/Controllers/MicropubClientController.php index d3bce24b..d93612f9 100644 --- a/app/Http/Controllers/MicropubClientController.php +++ b/app/Http/Controllers/MicropubClientController.php @@ -62,7 +62,7 @@ class MicropubClientController extends Controller $this->indieClient ); if (! $micropubEndpoint) { - return redirect(route('micropub-client'))->withErrors('Unable to determine micropub API endpoint', 'endpoint'); + return redirect(route('micropub-client'))->with('error', 'Unable to determine micropub API endpoint'); } $response = $this->postNoteRequest($request, $micropubEndpoint, $token); @@ -76,7 +76,7 @@ class MicropubClientController extends Controller return redirect($location); } - return redirect(route('micropub-client'))->withErrors('Endpoint didn’t create the note.', 'endpoint'); + return redirect(route('micropub-client'))->with('error', 'Endpoint didn’t create the note.'); } /** @@ -95,7 +95,7 @@ class MicropubClientController extends Controller $token = $request->session()->get('token'); $micropubEndpoint = $this->indieAuthService->discoverMicropubEndpoint($domain, $this->indieClient); if (! $micropubEndpoint) { - return redirect(route('micropub-client'))->withErrors('Unable to determine micropub API endpoint', 'endpoint'); + return redirect(route('micropub-client'))->with('error', 'Unable to determine micropub API endpoint'); } try { @@ -104,7 +104,7 @@ class MicropubClientController extends Controller 'query' => ['q' => 'syndicate-to'], ]); } catch (\GuzzleHttp\Exception\BadResponseException $e) { - return redirect(route('micropub-client'))->withErrors('Bad response when refreshing syndication targets', 'endpoint'); + return redirect(route('micropub-client'))->with('error', 'Bad response when refreshing syndication targets'); } $body = (string) $response->getBody(); $syndication = $this->parseSyndicationTargets($body); @@ -178,8 +178,7 @@ class MicropubClientController extends Controller 'headers' => $headers, ]); } catch (\GuzzleHttp\Exception\BadResponseException $e) { - return redirect(route('micropub-client')) - ->withErrors('There was a bad response from the micropub endpoint.', 'endpoint'); + return redirect(route('micropub-client'))->with('error', 'There was a bad response from the micropub endpoint.'); } return $response; diff --git a/resources/views/micropub/create.blade.php b/resources/views/micropub/create.blade.php index b1aeff9a..532912eb 100644 --- a/resources/views/micropub/create.blade.php +++ b/resources/views/micropub/create.blade.php @@ -5,13 +5,10 @@ New Note « @stop @section('content') +@if (session('error')) +

{{ session('error') }}

+@endif

This is my UI for posting new notes, hopefully you’ll soon be able to use this if your site supports the micropub API.

-@if($errors->endpoint->first() != '') -

{{ $errors->endpoint->first() }}

-@endif -@if($errors->indieauth->first() != '') -

{{ $errors->indieauth->first() }}

-@endif @if($url === null)