mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-09 16:24:51 +00:00
Update BaseApiController, uncache verify_credentials method
This commit is contained in:
parent
49efaae96c
commit
3fa9ac8bd9
1 changed files with 2 additions and 9 deletions
|
@ -310,15 +310,8 @@ class BaseApiController extends Controller
|
|||
{
|
||||
$user = $request->user();
|
||||
abort_if(!$user, 403);
|
||||
$id = $user->id;
|
||||
|
||||
$res = Cache::remember('user:account:id:'.$id, now()->addHours(6), function() use($id) {
|
||||
$profile = Profile::whereNull('status')->whereUserId($id)->firstOrFail();
|
||||
$resource = new Fractal\Resource\Item($profile, new AccountTransformer());
|
||||
$res = $this->fractal->createData($resource)->toArray();
|
||||
return $res;
|
||||
});
|
||||
|
||||
$resource = new Fractal\Resource\Item($user->profile, new AccountTransformer());
|
||||
$res = $this->fractal->createData($resource)->toArray();
|
||||
return response()->json($res);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue