public function login($username, $password) { try { $model = new UserModel($this->context->getService('database.default.context')); return $model->authenticate(array(0 => $username, 1 => $password)); } catch (\Exception $ex) { $this->sendErrorResource($ex); } }