mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-24 16:53:17 +00:00
Update BaseApiController, invalidate session after account deletion
This commit is contained in:
parent
3c62fa79c5
commit
826978ce08
1 changed files with 4 additions and 0 deletions
|
@ -314,6 +314,10 @@ class BaseApiController extends Controller
|
||||||
{
|
{
|
||||||
$user = $request->user();
|
$user = $request->user();
|
||||||
abort_if(!$user, 403);
|
abort_if(!$user, 403);
|
||||||
|
if($user->status != null) {
|
||||||
|
Auth::logout();
|
||||||
|
return redirect('/login');
|
||||||
|
}
|
||||||
$resource = new Fractal\Resource\Item($user->profile, new AccountTransformer());
|
$resource = new Fractal\Resource\Item($user->profile, new AccountTransformer());
|
||||||
$res = $this->fractal->createData($resource)->toArray();
|
$res = $this->fractal->createData($resource)->toArray();
|
||||||
return response()->json($res);
|
return response()->json($res);
|
||||||
|
|
Loading…
Reference in a new issue