Stop form from reloading page
This commit is contained in:
parent
e539eb0a75
commit
13f8852622
4 changed files with 7 additions and 4 deletions
|
|
@ -26,6 +26,7 @@ form {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
margin: 0 0 0 6px;
|
margin: 0 0 0 6px;
|
||||||
|
-webkit-appearance: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.saveButton:hover {
|
.saveButton:hover {
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ const FingerprintBlock = ({ workerData }) => {
|
||||||
if you clear cookies, change your IP or use private mode the hash will
|
if you clear cookies, change your IP or use private mode the hash will
|
||||||
stay the same. Enter a signature and turn on a VPN to test it out.
|
stay the same. Enter a signature and turn on a VPN to test it out.
|
||||||
</p>
|
</p>
|
||||||
<form onSubmit={(e) => postSignature(hash, e.target[0].value)}>
|
<form onSubmit={(e) => postSignature(hash, e, setSignature)}>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
id="signature"
|
id="signature"
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ const getConnection = (data) => {
|
||||||
issues: [isProxy],
|
issues: [isProxy],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'Organization',
|
key: 'Org',
|
||||||
value: data.org,
|
value: data.org,
|
||||||
issues: [isProxy],
|
issues: [isProxy],
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,13 @@ const getSignature = (hash, setSignature, setload) => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const postSignature = (hash, signature) => {
|
const postSignature = (hash, e, setSignature) => {
|
||||||
|
e.preventDefault();
|
||||||
axios.post('https://api.vytal.io/fingerprint/', {
|
axios.post('https://api.vytal.io/fingerprint/', {
|
||||||
name: signature,
|
name: e.target[0].value,
|
||||||
hash,
|
hash,
|
||||||
});
|
});
|
||||||
|
setSignature(e.target[0].value);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getHash = (data) => md5(JSON.stringify(data)).toString();
|
const getHash = (data) => md5(JSON.stringify(data)).toString();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue