mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 22:41:27 +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();
|
||||
abort_if(!$user, 403);
|
||||
if($user->status != null) {
|
||||
Auth::logout();
|
||||
return redirect('/login');
|
||||
}
|
||||
$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