57f63537 by Janis

Merge branch '27528_apply_authv2_chatgpt' into 'master'

27528_apply_authv2_chatgpt

See merge request !61
2 parents fc25e31a 16c7e035
......@@ -11,7 +11,6 @@
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<script src='https://api.ai-pro.org/ext-app/js/btutil-common-v1.min.js?ver=202306291729'></script>
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
......@@ -27,32 +26,11 @@
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>AI-Pro ChatGPT</title>
<script src='%REACT_APP_BTCOMPONENT_S3_URL%/common/btutil-authenticate.min.js'></script>
<script>
let aiUser = btutil_getCookie('aiwp_logged_in');
if(!aiUser) {
window.location.href = '%REACT_APP_AUTH_FAILED_REDIRECTION_URL%';
} else {
let objBody = { aiwp_logged_in: aiUser };
let params = [];
params['objBody'] = objBody;
params['strUrl'] = '%REACT_APP_EXTERNAL_API_URL%/e/v1/authenticate/';
btutil_checkAuthentication(params, cbCheckAuthentication, cbErrCheckAuthentication);
function cbCheckAuthentication(res) {
// console.log(res);
if (!res.success) {
window.location.href = '%REACT_APP_AUTH_FAILED_REDIRECTION_URL%';
} else {
document.getElementById("root").classList.add("active");
}
}
function cbErrCheckAuthentication(res) {
console.log(res);
}
}
let ver = new Date().getTime();
let btutilAsset = document.createElement('script');
btutilAsset.setAttribute('src', "%REACT_APP_BTUTIL_ASSET_URL%" + ver);
document.head.appendChild(btutilAsset);
</script>
</head>
<body>
......
......@@ -10,8 +10,4 @@ body {
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}
#root:not(.active) {
display: none;
}
\ No newline at end of file
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!