我已经设置了everyauth,看起来很不错。
现在,正如这个NodeTuts 插曲所示,必须去http://www.example.com/auth/facebookorhttp://www.example.com/auth/twitter才能进行身份验证。
如何配置everyauth允许我将 JavaScript 事件附加到按钮以触发身份验证?
例如,在下面的代码中,点击底部的按钮应该会弹出一个 Facebook 身份验证窗口。我该如何使用everyauth?
<html>
<head>
<title>My Facebook Login Page</title>
</head>
<body>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'YOUR_APP_ID',
status : true,
cookie : true,
xfbml : true,
oauth : true,
});
};
(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
</script>
<div class="fb-login-button">Login with Facebook</div>
</body>
</html>