Check in the frontend if the username and password in the survey are correct (fix #179) #185
2 changed files with 1 additions and 27 deletions
|
@ -134,7 +134,6 @@ def protected():
|
|||
|
||||
|
||||
@app.route('/api/protected/rcv_pw', methods=['GET'])
|
||||
# @flask_praetorian.auth_required
|
||||
def get_password():
|
||||
pw = get_random_password()
|
||||
ret = {'password': pw}
|
||||
|
|
|
@ -68,7 +68,6 @@ export default function Study() {
|
|||
setIsStepStart(false);
|
||||
setIsStepNormal(true);
|
||||
handleLoggerOn();
|
||||
// forceUpdate();
|
||||
};
|
||||
|
||||
const handleClickAtStepNormal = () => {
|
||||
|
@ -87,30 +86,6 @@ export default function Study() {
|
|||
handleLoggerOff();
|
||||
};
|
||||
|
||||
const onSubmitClick = (e) => {
|
||||
e.preventDefault();
|
||||
let opts = {
|
||||
username: username,
|
||||
password: password,
|
||||
};
|
||||
fetch("/api/protected/behavior", {
|
||||
method: "post",
|
||||
body: JSON.stringify(opts),
|
||||
}).then((response) => {
|
||||
console.log(response.status);
|
||||
if (response.status === 401) {
|
||||
response.json().then((resp) => {
|
||||
console.log("nicht so wirklich gut");
|
||||
// setErrorMessage(resp.message);
|
||||
});
|
||||
} else {
|
||||
response.json().then((token) => {
|
||||
console.log("Alles gut :-)");
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const study_start = (
|
||||
<>
|
||||
<BehaviorStudyInfo />
|
||||
|
@ -189,7 +164,7 @@ export default function Study() {
|
|||
const study_standing = (
|
||||
<>
|
||||
<BehaviorStanding />
|
||||
<form id="behaviorPhone">
|
||||
<form id="behaviorStanding">
|
||||
<InputField
|
||||
LabelName="Benutzername"
|
||||
onChange={handleUsernameChange}
|
||||
|
|
Loading…
Reference in a new issue