From: Nick Downing Date: Tue, 25 Jan 2022 10:56:22 +0000 (+1100) Subject: In /my_account/sign_up/index.html.jst change placeholder for captcha text to xxxxxx... X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?p=ndcode_site.git;a=commitdiff_plain;h=624807167870802a42279bfbf6ee94c927a2bab9 In /my_account/sign_up/index.html.jst change placeholder for captcha text to xxxxxx (because the randomized value was too confusing), fix some minor bugs --- diff --git a/_lib/get_placeholder.jst b/_lib/get_placeholder.jst index 952de14..1d325e3 100644 --- a/_lib/get_placeholder.jst +++ b/_lib/get_placeholder.jst @@ -33,15 +33,6 @@ return async (env, session) => { ] let email = `${user}@${domain_name}` - captcha_text = [] - for (let i = 0; i < 6; ++i) { - let j = Math.floor(Math.random() * 36) - captcha_text.push( - '0123456789abcdefghijklmnopqrstuvwxyz'.slice(j, j + 1) - ) - } - captcha_text = captcha_text.join('') - let expires = new XDate(env.now) expires.addDays(1) @@ -49,7 +40,6 @@ return async (env, session) => { given_names: given_name, family_name, email, - captcha_text, expires: expires.getTime() } session.set_json('placeholder', placeholder) diff --git a/my_account/sign_up/index.html.jst b/my_account/sign_up/index.html.jst index 2aa7166..a3fd849 100644 --- a/my_account/sign_up/index.html.jst +++ b/my_account/sign_up/index.html.jst @@ -112,7 +112,7 @@ return async env => { div.col-md-6 { div.form-group { label.form-label(for="verification-code") {'Verification code *'} - input.form-control#verification-code(type="text" placeholder=placeholder.captcha_text required minlength=6 maxlength=6) {} + input.form-control#verification-code(type="text" placeholder='xxxxxx' required minlength=6 maxlength=6) {} div.invalid-feedback {'Please enter the 6 characters from the verification image to right or below. We need this to protect us from spam and bots.'} } } @@ -137,7 +137,7 @@ return async env => { } else button.btn.btn-success.ml-3#card-1-create-account(type="button" disabled) { - div.icon24-outer.rm-2 { + div.icon24-outer.mr-2 { div.icon24-inner {_out.push(fa_user_plus)} } 'Create account' @@ -232,7 +232,10 @@ return async env => { input_semaphore.try_acquire() await api_call( '/api/account/sign_up/set_draft.json', - id_card_1_create_account.disabled ? + id_given_names.value.length === 0 && + id_family_name.value.length === 0 && + id_contact_me.checked && + id_email.value.length === 0 ? null : { email: id_email.value.slice(0, 256).toLowerCase(), @@ -254,6 +257,7 @@ return async env => { id_family_name.value.length === 0 && id_contact_me.checked && id_email.value.length === 0 && + id_password.value.length === 0 && id_verification_code.value.length === 0 id_card_1_tick.hidden = true id_card_1_cross.hidden = true