summaryrefslogtreecommitdiffstats
path: root/frontend
diff options
context:
space:
mode:
authorJan Tuomi <jan.tuomi@eficode.com>2020-02-05 11:35:13 +0200
committerJan Tuomi <jan.tuomi@eficode.com>2020-02-05 11:35:13 +0200
commit81573cd2c7d7d7a5f7237c4283ba97a55300aa4d (patch)
tree5076d326c317757ff22d5b3b4569f79203656355 /frontend
parent2011d3f6f9938825a36670779fa0d7894bda338f (diff)
Implement CSP
Diffstat (limited to 'frontend')
-rw-r--r--frontend/public/index.html3
-rw-r--r--frontend/src/Home.js3
-rw-r--r--frontend/src/Login.js2
-rw-r--r--frontend/src/Register.js2
4 files changed, 8 insertions, 2 deletions
diff --git a/frontend/public/index.html b/frontend/public/index.html
index aa069f2..cc94d49 100644
--- a/frontend/public/index.html
+++ b/frontend/public/index.html
@@ -5,6 +5,9 @@
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
+ <meta http-equiv="Content-Security-Policy" content="default-src 'self' localhost:4000;
+ style-src 'self' 'unsafe-inline';
+ img-src * data:;" />
<meta
name="description"
content="Web site created using create-react-app"
diff --git a/frontend/src/Home.js b/frontend/src/Home.js
index cc37156..c67c69a 100644
--- a/frontend/src/Home.js
+++ b/frontend/src/Home.js
@@ -19,6 +19,9 @@ const Home = observer(({ user }) => {
<div>
<LogoutBtn />
Hello {user.username}!
+ <div>
+ <img src="https://placehold.it/200x200" alt="Placeholder" />
+ </div>
</div>
);
});
diff --git a/frontend/src/Login.js b/frontend/src/Login.js
index 1a1cb2b..d17a5ab 100644
--- a/frontend/src/Login.js
+++ b/frontend/src/Login.js
@@ -6,7 +6,7 @@ import axios from './axios';
import userState from './UserState';
const Login = () => {
- const { register, handleSubmit, watch, errors } = useForm();
+ const { register, handleSubmit } = useForm();
const [ loginError, setLoginError ] = useState(null);
const onSubmit = async data => {
diff --git a/frontend/src/Register.js b/frontend/src/Register.js
index e49b4ea..f4a6ec3 100644
--- a/frontend/src/Register.js
+++ b/frontend/src/Register.js
@@ -6,7 +6,7 @@ import axios from './axios';
import userState from './UserState';
const Register = () => {
- const { register, handleSubmit, watch, errors } = useForm();
+ const { register, handleSubmit } = useForm();
const [ loginError, setLoginError ] = useState(null);
const onSubmit = async data => {