Update some change password things..
This commit is contained in:
parent
a6346d7496
commit
58bd327377
3 changed files with 18 additions and 9 deletions
|
@ -83,6 +83,12 @@ export default function Study() {
|
|||
};
|
||||
|
||||
const _genPassword = useRef(null);
|
||||
let genPassword = "";
|
||||
|
||||
const setGenPassword = (tmp) => {
|
||||
genPassword = tmp;
|
||||
console.log("setGenPassword", genPassword, tmp);
|
||||
};
|
||||
|
||||
const receiveRandomPassword = () => {
|
||||
fetch("/api/rcv_pw", {
|
||||
|
@ -90,7 +96,8 @@ export default function Study() {
|
|||
}).then((response) => {
|
||||
response.json().then((resp) => {
|
||||
_genPassword.current = resp.random_password;
|
||||
console.log(_genPassword.current)
|
||||
console.log(_genPassword.current);
|
||||
setGenPassword(_genPassword.current);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
@ -110,7 +117,7 @@ export default function Study() {
|
|||
if (checkIfPasswordIsCorrect() && checkIfUsernameIsCorrect) {
|
||||
return true;
|
||||
} else {
|
||||
alert("Passt nicht")
|
||||
alert("Passt nicht");
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
@ -123,7 +130,7 @@ export default function Study() {
|
|||
};
|
||||
|
||||
const handleClickAtStepNormal = () => {
|
||||
if (checkIfValuesAreCorrect()){
|
||||
if (checkIfValuesAreCorrect()) {
|
||||
receiveRandomPassword();
|
||||
setIsStepNormal(false);
|
||||
setIsStepPhone(true);
|
||||
|
@ -158,7 +165,7 @@ export default function Study() {
|
|||
|
||||
const study_normal = (
|
||||
<>
|
||||
<BehaviorNormal />
|
||||
<BehaviorNormal genPassword={_genPassword.current} />
|
||||
<form id="behaviorNormal">
|
||||
<InputField
|
||||
LabelName="Benutzername"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue