Skip to content

Commit

Permalink
Merge pull request #1702 from airqo-platform/netmanager-security-impl…
Browse files Browse the repository at this point in the history
…ementation

[Netmanager] Enhancing Security Measures
  • Loading branch information
Baalmart authored Nov 17, 2023
2 parents 09186b7 + 83dbe0e commit ad3ef12
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions netmanager/.env.sample
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
REACT_APP_ALLOW_DEV_TOOLS=12345689
REACT_APP_BASE_URL=https://staging-platform.airqo.net/api/v1/
REACT_APP_BASE_URL_V2=https://staging-platform.airqo.net/api/v2/
REACT_APP_BASE_ANALYTICS_URL=
Expand Down
21 changes: 20 additions & 1 deletion netmanager/src/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable */
import React from 'react';
import React, { useEffect } from 'react';
import './App.css';

import jwt_decode from 'jwt-decode';
Expand Down Expand Up @@ -47,6 +47,25 @@ if (localStorage.jwtToken) {
}

const App = () => {
// disabling feature
useEffect(() => {
if (process.env.REACT_APP_ALLOW_DEV_TOOLS === 'staging') {
return;
} else {
// Disable context menu (right click)
document.addEventListener('contextmenu', (e) => {
e.preventDefault();
});

// Disable F12 key (open developer tools)
document.addEventListener('keydown', (e) => {
if (e.keyCode === 123) {
e.preventDefault();
}
});
}
}, []);

return (
<Provider store={store}>
<ThemeProvider theme={theme}>
Expand Down

0 comments on commit ad3ef12

Please sign in to comment.