I want to create smart contract for login. When users input username and password are correct its will return true and incorrect return false to my web application.
Model
participant SampleParticipant identified by participantId {
o String participantId
o String username
o String password
}
transaction SampleLogin {
--> SampleParticipant participant
o String inputUsername
o String inputPassword
}
Transaction
function sampleLogin(tx) {
var username = tx.participant.username;
var password = tx.participant.password;
var inputUsername = tx.inputUsername;
var inputPassword = tx.inputPassword;
if (username == inputUsername && password == inputPassword){
//return true;
}else{
//return false;
}
}
I want get with this. https://localhost:3000/api/SampleLogin
return True or False