request = $request; $this->integration_user = $integration_user; } /** * @return JSON_Response|Redirect_Response|View_Response * * @throws TokenNotFoundException * @throws API_Exception * @throws AuthorizationException */ public function handle() { if ( ! $this->integration_user->exists() ) { if ( $this->request->is_ajax() ) { return $this->json( [ 'error' => 'Integration user not found.', ], 403 ); } return $this->redirect( new Action_URL( Action_Index::SUBMENU_CHANNEL ) ); } return $this->next->handle(); } }