sabyasachibiswal / angular5-social-login

Social authentication module for Angular 5. Includes Facebook and Google login with AOT compatibility.
40 stars 74 forks source link

To add scope in request. #23

Open amitrana4 opened 6 years ago

amitrana4 commented 6 years ago

If we need page list and other info of user we need to pass a scope which add permission links in facebook auth page while login.

Solution : We need to add more scope like below.

return new Promise(function (resolve, reject) { FB.login(function (response) { if (response.authResponse) { var /* @type {?} / accessToken_2 = FB.getAuthResponse()['accessToken']; FB.api('/me?fields=name,email,picture', function (res) { resolve(FacebookLoginProvider.drawUser(Object.assign({}, { token: accessToken_2 }, res))); }); } }, { scope: 'email,public_profile,manage_pages,pages_manage_instant_articles,pages_show_list,publish_pages,read_insights' }); });