Do not allow copy and paste in survey (fix #197)

This commit is contained in:
cami 2021-07-23 00:59:39 +02:00
parent 90e77bf450
commit 1d0f898fc9
2 changed files with 5 additions and 2 deletions

View file

@ -9,7 +9,7 @@ export default function GeneratedPassword(props) {
return ( return (
<> <>
<p onCopy={handleOnCopyEvent}> <p>
Das Passwort für diese Situation lautet:{" "} Das Passwort für diese Situation lautet:{" "}
<span className="generated-password">{props.genPassword}</span> <span className="generated-password">{props.genPassword}</span>
</p> </p>

View file

@ -75,6 +75,10 @@ export default function Study() {
e.preventDefault(); e.preventDefault();
return false; return false;
}; };
const handleOnCopyEvent = (e) => {
e.preventDefault();
return false;
};
const checkIfUsernameIsCorrect = () => { const checkIfUsernameIsCorrect = () => {
return serverUsername === username; return serverUsername === username;
@ -96,7 +100,6 @@ export default function Study() {
}; };
const checkIfValuesAreCorrect = () => { const checkIfValuesAreCorrect = () => {
console.log(checkIfPasswordIsCorrect());
return checkIfPasswordIsCorrect() && checkIfUsernameIsCorrect(); return checkIfPasswordIsCorrect() && checkIfUsernameIsCorrect();
}; };