From d220f86cb833f08cfa187865ef7adda70d0b72c4 Mon Sep 17 00:00:00 2001 From: cami Date: Sat, 24 Jul 2021 01:10:40 +0200 Subject: [PATCH 1/3] Remove the input if someone typed the wrong password --- frontend/src/components/pages/Study.jsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/pages/Study.jsx b/frontend/src/components/pages/Study.jsx index 2694809..a9e0ca1 100644 --- a/frontend/src/components/pages/Study.jsx +++ b/frontend/src/components/pages/Study.jsx @@ -115,10 +115,11 @@ export default function Study() { }; const resetInputValues = () => { - let inputElements = document.querySelectorAll('div input:not([type="submit"])'); - for (let i=0; i < inputElements.length; i++){ - inputElements[i].value = "" - + let inputElements = document.querySelectorAll( + 'div input:not([type="submit"])' + ); + for (let i = 0; i < inputElements.length; i++) { + inputElements[i].value = ""; } }; From c52308e6231b3d2f28b9dcd877ff732ead28bdd9 Mon Sep 17 00:00:00 2001 From: cami Date: Sat, 24 Jul 2021 01:14:25 +0200 Subject: [PATCH 2/3] Update logger config and create a session usermapping --- frontend/src/components/pages/Study.jsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/pages/Study.jsx b/frontend/src/components/pages/Study.jsx index a9e0ca1..48e4718 100644 --- a/frontend/src/components/pages/Study.jsx +++ b/frontend/src/components/pages/Study.jsx @@ -32,11 +32,8 @@ export default function Study() { useEffect(() => { _logger.current = new Logger({ - //inputs: ["cursor", "wheel", "keyboard", "touch"], - inputs: ["keyboard"], - // apiUrl: "https://behavior.marcocamenzind.ch", - apiUrl: "http://localhost:5000", - logToConsole: true, + inputs: ["keyboard", "wheel", "cursor", "custom"], + apiUrl: "https://behavior.marcocamenzind.ch", }); _logger.current.init(); authFetch("/api/username", { @@ -112,6 +109,12 @@ export default function Study() { receiveRandomPassword(); setState(STATES.NORMAL); handleLoggerOn(); + // map username and session with the logs + _logger.current.logCustomEvent( + { + name: serverUsername, + }, + ); }; const resetInputValues = () => { From deecf9ccad49d758e7ec0c0fbfe5af9187812e4c Mon Sep 17 00:00:00 2001 From: cami Date: Sat, 24 Jul 2021 01:16:39 +0200 Subject: [PATCH 3/3] Removed unused function --- frontend/src/components/GeneratedPassword.jsx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/frontend/src/components/GeneratedPassword.jsx b/frontend/src/components/GeneratedPassword.jsx index 1dfb3af..7536737 100644 --- a/frontend/src/components/GeneratedPassword.jsx +++ b/frontend/src/components/GeneratedPassword.jsx @@ -2,11 +2,6 @@ import React from "react"; import "../App.css"; export default function GeneratedPassword(props) { - const handleOnCopyEvent = (e) => { - e.preventDefault(); - return false; - }; - return ( <>