fix

parent f24ed5c6
...@@ -32,13 +32,12 @@ const SignUp = () => { ...@@ -32,13 +32,12 @@ const SignUp = () => {
const onChangeCredentials = (e: React.ChangeEvent<HTMLInputElement>) => { const onChangeCredentials = (e: React.ChangeEvent<HTMLInputElement>) => {
setCredentials({ ...credentials, [e.target.name]: e.target.value }); setCredentials({ ...credentials, [e.target.name]: e.target.value });
}; };
const onSumit = () => { const onSumit = () => {
if (credentials.password !== credentials.confrimPassword) { if (credentials.password !== credentials.confrimPassword) {
return setAlert("Passwords do not match"); return setAlert("Passwords do not match");
} }
resetData();
const data = { const data = {
username: credentials.userName, username: credentials.userName,
passwords: [ passwords: [
...@@ -50,6 +49,10 @@ const SignUp = () => { ...@@ -50,6 +49,10 @@ const SignUp = () => {
keyup: keyupArray.current, keyup: keyupArray.current,
}; };
console.log("DATA ", data);
resetData();
fetch("http://localhost:3001/user/signup", { fetch("http://localhost:3001/user/signup", {
method: "POST", method: "POST",
mode: "cors", mode: "cors",
...@@ -216,6 +219,7 @@ const SignUp = () => { ...@@ -216,6 +219,7 @@ const SignUp = () => {
onChange={onChangeCredentials} onChange={onChangeCredentials}
value={credentials.confrimPassword} value={credentials.confrimPassword}
onKeyDown={onKeyDown} onKeyDown={onKeyDown}
onKeyUp={onKeyUp}
id="password-1" id="password-1"
/> />
</div> </div>
...@@ -249,6 +253,7 @@ const SignUp = () => { ...@@ -249,6 +253,7 @@ const SignUp = () => {
onChange={onChangeCredentials} onChange={onChangeCredentials}
value={credentials.twoFAPassword} value={credentials.twoFAPassword}
onKeyDown={onKeyDown} onKeyDown={onKeyDown}
onKeyUp={onKeyUp}
id="password-2" id="password-2"
/> />
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment