URLを更新するFacebookボタンがありますon-login
<fb:login-button perms="email,user_about_me,user_photos" on-login="window.location = 'http://myDomain.com';">Login</fb:login-button>
しかし、標準のFacebookボタンを使用せず、javascriptで独自のマークアップを使用することにした場合は、
ログイン
時にコールバックを取得するのに苦労しているようです
。
function fb_oAuth(){
FB.ui({
method: "permissions.request",
"perms": 'email, user_about_me, user_photos'
} , function(response) {
console.log(response);
/* if (response.session) {
window.location.href = 'http://www.myDomain.com';
} */
});
/* FB.Event.subscribe('auth.sessionChange', function(response) {
if (response.session) {
window.location.href = 'http://www.myDomain.com';
} else {
// The user has logged out, and the cookie has been cleared
}
}); */
});
// HTML button
<a href="#" onClick="fb_oAuth(); event.preventDefault();">Login with Facebook</a>