/** * Dispatch onVerified hook * * @param string $type Verify type: email or sms * @param array $body JSON decoded body params */ private function dispatchOnVerified($type, $body) { $userObj = LeanClient::decode($body["object"], null); LeanUser::saveCurrentUser($userObj); $meta["remoteAddress"] = $this->env["REMOTE_ADDR"]; try { Cloud::runOnVerified($type, $userObj, $meta); } catch (FunctionError $err) { $this->renderError($err->getMessage(), $err->getCode()); } $this->renderJSON(array("result" => "ok")); }