I am using mqtt paho javascript client library to connect to an mqtt server,i am able to connect to server with username and password, now the issue is ...how can i warn user if he gives wrong username or password.i followed this link is there any onFailure function to report an error if user credentials are wrong??
client.connect({onSuccess:this.onConnect.bind(this),userName:Name,password:Password},{onFailure:console.log("failed")});
onConnect() {
// Once a connection has been made, make a subscription and send a message.
console.log("onConnect");
}
even though I am able to connect , I can see but "onConnect" and "failed" messages in my console