authService = $authService; } /** * get - handle get requests */ public function get(array $params): Response { $userId = session('userdata.id'); $sessionId = session()->getId(); // @TODO: Once we have a session table, check the session is valid in there as well as // added security layer. If not we can log the user out. $return = $this->authService->updateUserSessionDB($userId, $sessionId); $response = ['status' => 'ok']; if (! $return) { $response['status'] = 'logout'; } return new JsonResponse($response); } }