Lots of route and controller method names refactoring, which also necessitated editing of fetch methods in the front end es6 code
This commit is contained in:
parent
8a6e99d97e
commit
b8c0724036
23 changed files with 88 additions and 99 deletions
|
@ -106,7 +106,7 @@ class MicropubController extends Controller
|
|||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function getEndpoint(Request $request)
|
||||
public function get(Request $request)
|
||||
{
|
||||
$httpAuth = $request->header('Authorization');
|
||||
if (preg_match('/Bearer (.+)/', $httpAuth, $match)) {
|
||||
|
@ -162,16 +162,11 @@ class MicropubController extends Controller
|
|||
],
|
||||
]);
|
||||
}
|
||||
$content = 'No OAuth token sent with request.';
|
||||
$content = <<<'EOD'
|
||||
{
|
||||
"response": "error",
|
||||
"error": "no_token",
|
||||
"error_description": "No token provided with request"
|
||||
}
|
||||
EOD;
|
||||
|
||||
return (new Response($content, 400))
|
||||
->header('Content-Type', 'application/json');
|
||||
return response()->json([
|
||||
'response' => 'error',
|
||||
'error' => 'no_token',
|
||||
'error_description'
|
||||
], 400);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue