mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 01:55:40 +00:00
uname & email check
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<title>Login | mCaptcha</title>
|
||||
</head>
|
||||
<body>
|
||||
<img src="./img/icon-trans.png" class="form__logo" alt="" />
|
||||
<img src="/img/icon-trans.png" class="form__logo" alt="" />
|
||||
<h2 class="form__brand">Sign in to mCaptcha</h2>
|
||||
|
||||
<div class="form-container">
|
||||
@@ -31,9 +31,11 @@
|
||||
id="password"
|
||||
required
|
||||
/>
|
||||
<a class="form__pw-recovery" -href="/forgot/password"
|
||||
<!--
|
||||
<a class="form__pw-recovery" -href="/recovert/password"
|
||||
>Forgot password?</a
|
||||
>
|
||||
-->
|
||||
</label>
|
||||
<button class="form__submit-button" type="submit">
|
||||
Submit
|
||||
@@ -139,4 +141,43 @@
|
||||
}
|
||||
|
||||
</style>
|
||||
<script>
|
||||
export const SUBMIT = '/';
|
||||
|
||||
export const isBlankString = (event, value, field) => {
|
||||
if (!value.replace(/\s/g, '').length) {
|
||||
event.preventDefautl()
|
||||
alert(`${field} can't be empty`);
|
||||
}
|
||||
};
|
||||
|
||||
export const genJsonPayload = payload => {
|
||||
let value = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(payload),
|
||||
};
|
||||
return value;
|
||||
};
|
||||
|
||||
const submit = async e => {
|
||||
let name = document.getElementById('name').value;
|
||||
isBlankString(e, name, 'Name');
|
||||
|
||||
let registration_number = document.getElementById('email').value;
|
||||
isBlankString(e, registration_number, 'Registration number');
|
||||
|
||||
let email = document.getElementById('email').value;
|
||||
isBlankString(e, email, 'email');
|
||||
|
||||
console.log(`from signup: PoW: ${pow}`);
|
||||
|
||||
};
|
||||
|
||||
let form = document.getElementById('form');
|
||||
|
||||
form.addEventListener('submit', submit, true);
|
||||
</script>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user