OpenFB icon indicating copy to clipboard operation
OpenFB copied to clipboard

Logout Problem

Open pfdundar opened this issue 10 years ago • 7 comments

Hello, I use cordova/phonegap, when I logout from facebook, token becomes null, there is no problem here. However, It doesnt ask me facebook password or email when I click the login button again. So It doesnt allow me login different users. I think I can logout from app but cannot logout from inapp browser. How can I solve this problem?

pfdundar avatar Jan 31 '15 16:01 pfdundar

I think you need to deauth the application

Through the native js api it would be FB.api("/me/permissions", "delete", function(response){});

hutchic avatar Mar 05 '15 05:03 hutchic

For that you could use the revokePermissions method which encapsulates the native api call @hutchic mentioned.

Back to topic: I got the same issue with that. I guess its because when you run it as an hybrid app on your phone there might be a problem with the redirect-url as the app does run within the filesystem and not under some domain.

@ccoenraets mentioned this as a comment above the logout method.

* IMPORTANT: For the Facebook logout to work, 
the logoutRedirectURL must be on the domain 
specified in "Site URL" in your Facebook App Settings

Maybe related with #35 and #10

Actually the following seemed to solve the problem. But I did not fully test everything by now.

https://github.com/vielhuber/OpenFB/commit/6cff3852e4a04b377eb4f654265a2ba1431bd316

nicowenterodt avatar Mar 22 '15 15:03 nicowenterodt

the ,clearcache=yes fixed the logout problem for me. I only added it to the logout function and i removed the settimeout function because it's not needed for me..

pruimmartin avatar Apr 08 '15 21:04 pruimmartin

I beleive the problem is a BUG, the tokenStore key is incorrect, it should be tokenStore.removeItem('fbAccessToken');

// openfb.js
var logoutWindow,
            token = tokenStore.fbAccessToken;

        /* Remove token. Will fail silently if does not exist */
        tokenStore.removeItem('fbtoken');  // change to tokenStore.removeItem('fbAccessToken');


mixersoft avatar Jun 08 '15 10:06 mixersoft

I beleive the problem is a BUG, the tokenStore key is incorrect, it should be tokenStore.removeItem('fbAccessToken');

// openfb.js
var logoutWindow,
            token = tokenStore.fbAccessToken;

        /* Remove token. Will fail silently if does not exist */
        tokenStore.removeItem('fbtoken');  // change to tokenStore.removeItem('fbAccessToken');


mixersoft avatar Jun 08 '15 11:06 mixersoft

I can confirm that changing

tokenStore.removeItem('fbtoken'); 

to

tokenStore.removeItem('fbAccessToken');

fixes the logout issue.

chrisschaub avatar Oct 02 '15 22:10 chrisschaub

Yes, after changing it to -> tokenStore.removeItem('fbAccessToken') the issue has been fixed. Thanks

nagubabu avatar Oct 27 '16 14:10 nagubabu