Open chopfitzroy opened 7 years ago
You need to enable the Facebook Login script as shown in https://developers.facebook.com/docs/javascript/examples#login
Then, after initialization, check the user login status. If he isn't logged in, then redirect him:
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
console.log('Logged in.');
} else {
location.href = '/auth/facebook';
}
});
Using the express example in the README I would like to check if the user is logged in at the index and if they are not redirect them to
/auth/facebook
is there a nice way to handle this?Cheers.