UX: log in with email

This commit is contained in:
realaravinth 2021-06-29 19:52:22 +05:30
parent d5aceb60b4
commit 11cba8f32e
No known key found for this signature in database
GPG key ID: AD9F0F08E855ED88
2 changed files with 10 additions and 10 deletions

View file

@ -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>

View file

@ -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,
};