mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 10:05:41 +00:00
show password component
This commit is contained in:
@@ -36,7 +36,8 @@
|
||||
id="password"
|
||||
required
|
||||
/>
|
||||
</label>
|
||||
<. include!("../../components/showPassword/index.html"); .>
|
||||
</label>
|
||||
|
||||
<input type="submit" class="sitekey-form__submit" value="Sign in" />
|
||||
</form>
|
||||
|
||||
@@ -20,6 +20,7 @@ import VIEWS from '../../../views/v1/routes';
|
||||
import isBlankString from '../../../utils/isBlankString';
|
||||
import genJsonPayload from '../../../utils/genJsonPayload';
|
||||
import getFormUrl from '../../../utils/getFormUrl';
|
||||
import registerShowPassword from '../../../components/showPassword';
|
||||
|
||||
//import '../forms.scss';
|
||||
|
||||
@@ -62,4 +63,5 @@ const login = async (e: Event) => {
|
||||
export const index = () => {
|
||||
const form = <HTMLFontElement>document.getElementById('form');
|
||||
form.addEventListener('submit', login, true);
|
||||
registerShowPassword();
|
||||
};
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
action="<.= crate::V1_API_ROUTES.auth.register .>"
|
||||
class="sitekey-form" id="form">
|
||||
<h1 class="form__title">
|
||||
Join mCaptcah
|
||||
Join mCaptcha
|
||||
</h1>
|
||||
|
||||
<label class="sitekey-form__label" for="username"
|
||||
@@ -50,6 +50,8 @@
|
||||
id="password"
|
||||
required
|
||||
/>
|
||||
<. include!("../../components/showPassword/index.html"); .>
|
||||
|
||||
</label>
|
||||
|
||||
<label for="password" class="sitekey-form__label"
|
||||
@@ -62,6 +64,7 @@
|
||||
id="password-check"
|
||||
required
|
||||
/>
|
||||
<. include!("../../components/showPassword/index.html"); .>
|
||||
</label>
|
||||
<input type="submit" class="sitekey-form__submit" value="Sign up" />
|
||||
</form>
|
||||
|
||||
@@ -23,6 +23,7 @@ import genJsonPayload from '../../../utils/genJsonPayload';
|
||||
import userExists from './userExists';
|
||||
import emailExists from './emailExists';
|
||||
import getFormUrl from '../../../utils/getFormUrl';
|
||||
import registerShowPassword from '../../../components/showPassword';
|
||||
|
||||
//import '../forms.scss';
|
||||
|
||||
@@ -51,7 +52,7 @@ const registerUser = async (e: Event) => {
|
||||
return;
|
||||
}
|
||||
|
||||
let email: string|null = emailElement.value;
|
||||
let email: string | null = emailElement.value;
|
||||
if (!email.replace(/\s/g, '').length) {
|
||||
email = null;
|
||||
} else {
|
||||
@@ -83,4 +84,5 @@ export const index = () => {
|
||||
const form = <HTMLFontElement>document.getElementById('form');
|
||||
form.addEventListener('submit', registerUser, true);
|
||||
usernameElement.addEventListener('input', userExists, false);
|
||||
registerShowPassword();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user