Skip to content

Commit

Permalink
added ethereum private key sign in
Browse files Browse the repository at this point in the history
  • Loading branch information
sairaj-mote committed Oct 17, 2023
1 parent a2cfef9 commit 4ded446
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,7 @@ <h3>Profile</h3>
${contactInitial}
</div>
<text-field id="contact_name" value=${contactName} onchange=${(e) => changeContactName(e.target.value.trim())} ?disabled=${disableContactName}></text-field>
<p id="last_interaction_time">${lastInteraction}</p>
<p id="last_interaction_time" style="margin-bottom: 1rem;">${lastInteraction}</p>
</div>
<fieldset id="contact_options" class="flex flex-direction-column gap-0-3">
${addAsContact}
Expand Down Expand Up @@ -2346,7 +2346,10 @@ <h4 class="h4">Members</h4>
location.hash = floGlobals.isPrivKeySecured ? '#/sign_in' : `#/landing`;
}
getRef('sign_in_button').onclick = () => {
resolve(getRef('private_key_field').value.trim());
let privateKey = getRef('private_key_field').value.trim();
if (/^[0-9a-fA-F]{64}$/.test(privateKey)) //if hex private key might be ethereum
privateKey = coinjs.privkey2wif(privateKey);
resolve(privateKey);
getRef('private_key_field').value = '';
routeTo('loading');
};
Expand Down

0 comments on commit 4ded446

Please sign in to comment.