I am working with express js. I have a modal form which has username and password field. i am posting the form data using ajax call. everything works fine but only issue is the username and password which i am entering are visible in post header, so is there any way in jquery to encrypt the form data before submitting..
here is my code
$("#login").click(function(){
var d=$("#form-1").serialize();
// console.log("serialize data=",d);
$.ajax({
method : 'POST',
url :'/login',
data :d ,
success:function(response){
console.log("response=",response.message);
if (response.message=='success'){
$("#msg").hide();
$('#myModal').modal('toggle');
console.log('in if 83');
}
else
{
console.log("in else");
$("#msg").text("invalid username or password");
$("#msg").show();
}
}
});
});