mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 20:22:07 +00:00
Merge branch 'apifix' into develop
* apifix: Fix issues with API authentication. # Conflicts: # app/Api/V1/Controllers/BillController.php # app/Http/Middleware/HttpBinder.php # app/Transformers/AttachmentTransformer.php # app/Transformers/BillTransformer.php # app/Transformers/NoteTransformer.php # routes/api.php
This commit is contained in:
@@ -52,12 +52,16 @@ class BillController extends Controller
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
/** @var BillRepositoryInterface repository */
|
||||
$this->repository = app(BillRepositoryInterface::class);
|
||||
$user = Auth::guard('api')->user();
|
||||
$this->repository->setUser($user);
|
||||
parent::__construct();
|
||||
$this->middleware(
|
||||
function ($request, $next) {
|
||||
/** @var BillRepositoryInterface repository */
|
||||
$this->repository = app(BillRepositoryInterface::class);
|
||||
$this->repository->setUser(auth()->user());
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,10 +108,10 @@ class BillController extends Controller
|
||||
return Response::json($manager->createData($resource)->toArray());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \FireflyIII\Models\Bill $bill
|
||||
* @param Request $request
|
||||
* @param Bill $bill
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
|
Reference in New Issue
Block a user