ngFacebook
ngFacebook copied to clipboard
Logout should clear the cached-API
Is '$facebook.logout();' in javascript sufficient to logout a user on your frontend and clear the cache?
I think you have to call refresh() in the promise.then of logout and fill the error section by emptying user data and changing isLoggedIn to false .
$facebook.logout()
invoke the facebook-js-sdk logout
function, which logging you out from the app and from FB website.
The cachedAPI
is caching the requests results on the current session, in order to reduce the requests to facebook.
So, currently the answer is no, but you do have a valid point.
I'll work on that as soon as I can.
Dear AlmogBaku,
I am using ngFacebook in my Angular js project. I have a problem with $facebook.logout() , this gives an error "FB.logout() called without an access token".
I When I am using $facebook.login() then $facebook.logout() is working fine.
But I When I am using $facebook.login() and after login I refreshed the page then $facebook.logout() is not working and rest of the functionality is working fine like. $facebook.api('/me?access_token='+accessToken).then(function(response){ // my stuff }
Thanks!