mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2025-03-31 05:33:28 +03:00
UX: log in with email
This commit is contained in:
parent
d5aceb60b4
commit
11cba8f32e
2 changed files with 10 additions and 10 deletions
|
@ -16,13 +16,13 @@
|
||||||
<h1 class="form__title">
|
<h1 class="form__title">
|
||||||
Signin to mCaptcha
|
Signin to mCaptcha
|
||||||
</h1>
|
</h1>
|
||||||
<label class="sitekey-form__label" for="username">
|
<label class="sitekey-form__label" for="login">
|
||||||
Username
|
Username or email address
|
||||||
<input
|
<input
|
||||||
class="sitekey-form__input"
|
class="sitekey-form__input"
|
||||||
type="text"
|
type="text"
|
||||||
name="username"
|
name="login"
|
||||||
id="username"
|
id="login"
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
|
|
|
@ -27,14 +27,14 @@ import createError from '../../../components/error/index';
|
||||||
|
|
||||||
const login = async (e: Event) => {
|
const login = async (e: Event) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const usernameElement = <HTMLInputElement>document.getElementById('username');
|
const loginElement = <HTMLInputElement>document.getElementById('login');
|
||||||
if (usernameElement === null) {
|
if (loginElement === null) {
|
||||||
console.debug('Username element is null');
|
console.debug('login element element is null');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const username = usernameElement.value;
|
const login = loginElement.value;
|
||||||
isBlankString(username, 'username', e);
|
isBlankString(login, 'username', e);
|
||||||
|
|
||||||
const passwordElement = <HTMLInputElement>document.getElementById('password');
|
const passwordElement = <HTMLInputElement>document.getElementById('password');
|
||||||
if (passwordElement === null) {
|
if (passwordElement === null) {
|
||||||
|
@ -45,7 +45,7 @@ const login = async (e: Event) => {
|
||||||
const password = passwordElement.value;
|
const password = passwordElement.value;
|
||||||
|
|
||||||
const payload = {
|
const payload = {
|
||||||
username,
|
login,
|
||||||
password,
|
password,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue