I'm trying to design a user interface for private blockchain using Ethereum to test my contracts. So, users with different password and account address login.
I'm aware of this question, but it was posted a long time ago.
I want a way to alert a user when it put in incorrect password/account_address to unlock its account. But the problem is that,
web3.personal.unlockAccount(account,password)
doesn't return false, when it cannot unlock.
Question: How can I alert a user when it inserts wrong password or address?
In my HTML/.js file I have a login like this:
var password="";
var account="";
// user inserts its password and account_address using "onclick"
// then logIn() is called
function logIn(){
var pass= document.getElementById("pass").value;
var addrx =document.getElementById("addrx").value;
//var myaddress = document.getElementById("myaddress").value;
password=pass;
account= addrx;
if (!web3.personal.unlockAccount(account,password)) // here is where I want to detect incorrect inputs.
alert("Password/address is incorrect");
}