mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2025-06-13 17:56:37 +00:00
UX: log in with email
This commit is contained in:
parent
d5aceb60b4
commit
11cba8f32e
@ -16,13 +16,13 @@
|
||||
<h1 class="form__title">
|
||||
Signin to mCaptcha
|
||||
</h1>
|
||||
<label class="sitekey-form__label" for="username">
|
||||
Username
|
||||
<label class="sitekey-form__label" for="login">
|
||||
Username or email address
|
||||
<input
|
||||
class="sitekey-form__input"
|
||||
type="text"
|
||||
name="username"
|
||||
id="username"
|
||||
name="login"
|
||||
id="login"
|
||||
required
|
||||
/>
|
||||
</label>
|
||||
|
@ -27,14 +27,14 @@ import createError from '../../../components/error/index';
|
||||
|
||||
const login = async (e: Event) => {
|
||||
e.preventDefault();
|
||||
const usernameElement = <HTMLInputElement>document.getElementById('username');
|
||||
if (usernameElement === null) {
|
||||
console.debug('Username element is null');
|
||||
const loginElement = <HTMLInputElement>document.getElementById('login');
|
||||
if (loginElement === null) {
|
||||
console.debug('login element element is null');
|
||||
return;
|
||||
}
|
||||
|
||||
const username = usernameElement.value;
|
||||
isBlankString(username, 'username', e);
|
||||
const login = loginElement.value;
|
||||
isBlankString(login, 'username', e);
|
||||
|
||||
const passwordElement = <HTMLInputElement>document.getElementById('password');
|
||||
if (passwordElement === null) {
|
||||
@ -45,7 +45,7 @@ const login = async (e: Event) => {
|
||||
const password = passwordElement.value;
|
||||
|
||||
const payload = {
|
||||
username,
|
||||
login,
|
||||
password,
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user