Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Administrator
/
chatgpt.ai-pro.org
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
3
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
ec5556d8
authored
2023-04-11 17:18:51 +0800
by
Jonille Arreglo
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
27190_loggedin
1 parent
147ec800
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
23 deletions
client/public/assets/js/auth.js
client/public/index.html
client/src/index.js
client/public/assets/js/auth.js
deleted
100644 → 0
View file @
147ec80
let
aiUser
=
btutil_getCookie
(
'aiwp_logged_in'
);
let
objBody
=
{
aiwp_logged_in
:
aiUser
};
let
params
=
[];
params
[
'objBody'
]
=
objBody
;
params
[
'strUrl'
]
=
'https://test.api.ai-pro.org/e/v1/authenticate/'
;
//use envvar for https://test.api.ai-pro.org/ only
btutil_checkAuthentication
(
params
,
cbCheckAuthentication
,
cbErrCheckAuthentication
);
function
cbCheckAuthentication
(
res
)
{
// console.log(res);
if
(
!
res
.
success
)
{
window
.
location
.
href
=
"https://ai-pro.org/redirect-account-required/"
;
//use envvar
}
else
{
document
.
getElementById
(
"root"
).
classList
.
add
(
"active"
);
}
}
function
cbErrCheckAuthentication
(
res
)
{
console
.
log
(
res
);
}
\ No newline at end of file
client/public/index.html
View file @
ec5556d
...
...
@@ -26,6 +26,33 @@
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>
AI-Pro ChatGPT
</title>
<script
src=
'%REACT_APP_S3_LINK%/common/btutil-authenticate.min.js'
></script>
<script>
let
aiUser
=
btutil_getCookie
(
'aiwp_logged_in'
);
if
(
!
aiUser
)
{
window
.
location
.
href
=
'%REACT_APP_REDIRECT_ACCOUNT%'
;
}
else
{
let
objBody
=
{
aiwp_logged_in
:
aiUser
};
let
params
=
[];
params
[
'objBody'
]
=
objBody
;
params
[
'strUrl'
]
=
'%REACT_APP_API_LINK%/e/v1/authenticate/'
;
btutil_checkAuthentication
(
params
,
cbCheckAuthentication
,
cbErrCheckAuthentication
);
function
cbCheckAuthentication
(
res
)
{
// console.log(res);
if
(
!
res
.
success
)
{
window
.
location
.
href
=
'%REACT_APP_REDIRECT_ACCOUNT%'
;
}
else
{
document
.
getElementById
(
"root"
).
classList
.
add
(
"active"
);
}
}
function
cbErrCheckAuthentication
(
res
)
{
console
.
log
(
res
);
}
}
</script>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
...
...
client/src/index.js
View file @
ec5556d
...
...
@@ -16,6 +16,3 @@ root.render(
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals
();
appendScript
(
"https://btcomponent-1devt.s3.us-east-1.amazonaws.com/common/btutil-authenticate.min.js"
);
appendScript
(
"http://localhost:3000/assets/js/auth.js"
);
\ No newline at end of file
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment