Skip to content

Commit

Permalink
Provide option for seconday url
Browse files Browse the repository at this point in the history
  • Loading branch information
jomrazek committed Apr 25, 2024
1 parent 7446fdb commit bc8b78a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,16 @@ const App = () => {

// Prevent using incompatible environment and deployment
const pncUrl = webConfigService.getPncUrl();
console.log(pncUrl);
console.log(window.location.origin);
console.log(process.env.REACT_APP_WEB_UI_URL);
console.log(process.env.REACT_APP_WEB_SECONDARY_UI_URL);
console.log(window.location.hostname);
if (
// https://example.com
!pncUrl.startsWith(window.location.origin) &&
process.env.REACT_APP_WEB_UI_URL !== window.location.origin &&
(process.env.REACT_APP_WEB_UI_URL !== window.location.origin ||
process.env.REACT_APP_WEB_SECONDARY_UI_URL !== window.location.origin) &&
// example.com
window.location.hostname !== 'localhost'
) {
Expand Down

0 comments on commit bc8b78a

Please # to comment.