From 813855faf21cdc2cb390fe286fbea0231d4a5151 Mon Sep 17 00:00:00 2001 From: sairaj mote Date: Tue, 31 Aug 2021 16:50:11 +0530 Subject: [PATCH] Added private key validation to sign in page --- index.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index b07a2d5..47a3d52 100644 --- a/index.html +++ b/index.html @@ -67,7 +67,8 @@

Sign In

Welcome back, glad to see you again

- + Sign In

@@ -523,7 +524,7 @@ window.addEventListener('hashchange', e => showPage(window.location.hash)) window.addEventListener("load", () => { document.body.classList.remove('hide-completely') - // document.querySelectorAll('sm-input[data-flo-id]').forEach(input => input.customValidation = validateAddr) + document.querySelectorAll('sm-input[data-private-key]').forEach(input => input.customValidation = floCrypto.getPubKeyHex) document.addEventListener('keyup', (e) => { if (e.code === 'Escape') { hidePopup() @@ -568,7 +569,7 @@ pageId = targetPage } } - if(typeof myFloID === "undefined" && !(pageId === 'sign_up' || pageId === 'sign_in')) return + if(typeof myFloID === "undefined" && !(['sign_up', 'sign_in', 'loading'].includes(pageId))) return if (searchParams) { const urlSearchParams = new URLSearchParams('?' + searchParams); params = Object.fromEntries(urlSearchParams.entries()); @@ -631,11 +632,10 @@ } break; } - console.log(pageId, subPageId) document.querySelector('.sub-page:not(.hide-completely)')?.classList.add('hide-completely') getRef(subPageId)?.classList.remove('hide-completely') getRef('main_nav').querySelector('.nav-item--active')?.classList.remove('nav-item--active') - getRef('main_nav').querySelector(`.nav-item[href="${window.location.hash}`).classList.add('nav-item--active') + getRef('main_nav').querySelector(`.nav-item[href="#/${pageId}/${subPageId ? subPageId : ''}"]`).classList.add('nav-item--active') getRef(subPageId)?.animate([ { opacity: 0, @@ -826,10 +826,12 @@ getRef('sign_in_button').onclick = () => { resolve(getRef('private_key_field').value.trim()) getRef('private_key_field').value = '' + showPage('loading') } getRef('sign_up_button').onclick = () => { resolve(getRef('generated_private_key').value.trim()) getRef('generated_private_key').value = '' + showPage('loading') } }) }