Fix uploading files to S3

This commit is contained in:
Jonny Barnes 2018-01-27 21:52:24 +00:00
parent b1929ac65a
commit 7262f6a550
3 changed files with 11 additions and 6 deletions

View file

@ -110,7 +110,7 @@ class MicropubController extends Controller
public function get(): JsonResponse
{
try {
$tokenData = $this->tokenService->validateToken(request()->bearerToken());
$tokenData = $this->tokenService->validateToken(request()->input('access_token'));
} catch (InvalidTokenException $e) {
return $this->invalidTokenResponse();
}
@ -162,7 +162,7 @@ class MicropubController extends Controller
public function media(): JsonResponse
{
try {
$tokenData = $this->tokenService->validateToken(request()->bearerToken());
$tokenData = $this->tokenService->validateToken(request()->input('access_token'));
} catch (InvalidTokenException $e) {
return $this->invalidTokenResponse();
}
@ -289,7 +289,7 @@ class MicropubController extends Controller
private function saveFile(UploadedFile $file): string
{
$filename = Uuid::uuid4() . '.' . $file->extension();
Storage::disk('local')->put($filename, $file);
Storage::disk('local')->putFileAs('', $file, $filename);
return $filename;
}