diff --git a/frontend/src/App.css b/frontend/src/App.css index 85703b2..b31da3c 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -95,5 +95,4 @@ h1 { .generated-password { font-weight: bold; - user-select: none; } diff --git a/frontend/src/components/BehaviorNormal.jsx b/frontend/src/components/BehaviorNormal.jsx index 9a4e715..c427a02 100644 --- a/frontend/src/components/BehaviorNormal.jsx +++ b/frontend/src/components/BehaviorNormal.jsx @@ -10,6 +10,7 @@ export default function BehaviorNormal(props) { Passwort eingeben. Verhalten Sie sich einfach so, als ob Sie sich normalerweise anmelden.
+ {console.log("props", props)}+
Das Passwort für diese Situation lautet:{" "} + {console.log("component genpw, genpassword", props.genPassword)} {props.genPassword}
> diff --git a/frontend/src/components/pages/Study.jsx b/frontend/src/components/pages/Study.jsx index 2694809..54b8f8b 100644 --- a/frontend/src/components/pages/Study.jsx +++ b/frontend/src/components/pages/Study.jsx @@ -3,7 +3,6 @@ import "../../App.css"; import Footer from "../../Footer"; import InputField from "../InputField"; import SubmitField from "../SubmitField"; -import ErrorMessage from "../ErrorMessage"; import { Logger } from "@behametrics/logger-web"; import { Button } from "../Button"; import BehaviorStudyInfo from "../BehaviorStudyInfo"; @@ -25,10 +24,6 @@ export default function Study() { END: "end", }; const [state, setState] = useState(STATES.START); - const [isInputCorrect, setIsInputCorrect] = useState(true); - - const errorText = - "Das Passwort und der Benutzername stimmen nicht überein. Bitte prüfen Sie, dass Sie das Passwort richtig abgetippt und den Benutzernamen richtig eingegeben haben."; useEffect(() => { _logger.current = new Logger({ @@ -78,10 +73,7 @@ export default function Study() { const handleOnPasteEvent = (e) => { e.preventDefault(); - return false; - }; - const handleOnCopyEvent = (e) => { - e.preventDefault(); + console.log("paste not allowed"); return false; }; @@ -96,6 +88,7 @@ export default function Study() { response.json().then((resp) => { console.log(resp.random_password); setGenPassword(resp.random_password); + console.log("rcv pw; print genPassword", genPassword); }); }); }; @@ -105,6 +98,7 @@ export default function Study() { }; const checkIfValuesAreCorrect = () => { + console.log(checkIfPasswordIsCorrect()); return checkIfPasswordIsCorrect() && checkIfUsernameIsCorrect(); }; @@ -114,44 +108,28 @@ export default function Study() { handleLoggerOn(); }; - const resetInputValues = () => { - let inputElements = document.querySelectorAll('div input:not([type="submit"])'); - for (let i=0; i < inputElements.length; i++){ - inputElements[i].value = "" - - } - }; - const handleClickAtStepNormal = () => { if (checkIfValuesAreCorrect()) { receiveRandomPassword(); - setIsInputCorrect(true); setState(STATES.PHONE); - } else { - setIsInputCorrect(false); - resetInputValues(); } }; const handleClickAtStepPhone = () => { if (checkIfValuesAreCorrect()) { receiveRandomPassword(); - setIsInputCorrect(true); setState(STATES.STANDING); } else { - setIsInputCorrect(false); - resetInputValues(); + console.log("Passwort und Benutzername stimmen nicht."); } }; const handleClickAtStepStanding = () => { if (checkIfValuesAreCorrect()) { - setIsInputCorrect(true); setState(STATES.END); handleLoggerOff(); } else { - setIsInputCorrect(false); - resetInputValues(); + console.log("Passwort und Benutzername stimmen nicht."); } }; @@ -172,9 +150,8 @@ export default function Study() { const study_normal = ( <> -