当用户访问特定页面时,我已经为我的网站启用了Facebook重新认证(在codeigniter中完成)。这是我的代码:
$(window).load(function() {
$("a.facebook_reauth_login").on("click", function(e) {
var t = $(this);
e.preventDefault();
FB.usingButton = !0;
var n = base_url;
FB.login(function(e) {
if (e.authResponse) {
FB.api("/me", function(e) {
var t = n + "fbreauth";
$.ajax({
type: "POST",
data: $.param(e),
url: t,
dataType: "html",
success: function(e) { console.log(e);
},
error: function() {
alert("Some error occurred,please try after some time!")
}
})
})
} else {
alert("User cancelled login or did not fully authorize.")
}
}, { auth_type: 'reauthenticate' });
return false
})
});
现在的问题是,即使用户在不输入密码的情况下取消重新认证弹出窗口,e.authResponse也会返回true。如何验证用户是否输入了密码?