From 826978ce08529fe3b4d5d8b62b61612701f918b4 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 19 Feb 2020 22:53:04 -0700 Subject: [PATCH] Update BaseApiController, invalidate session after account deletion --- app/Http/Controllers/Api/BaseApiController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Http/Controllers/Api/BaseApiController.php b/app/Http/Controllers/Api/BaseApiController.php index a3a450c62..6b18f8358 100644 --- a/app/Http/Controllers/Api/BaseApiController.php +++ b/app/Http/Controllers/Api/BaseApiController.php @@ -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);