jeduan / cordova-plugin-facebook4

Use the latest Facebook SDK in your Cordova and Ionic projects
Other
764 stars 509 forks source link

Fix hasAccessToken check #853

Closed blackwolf12333 closed 4 years ago

blackwolf12333 commented 4 years ago

When an access token is expired this plugin would not fetch a new one. This is invalid behaviour and resulted in failed login attempts because the token was expired, but still passed to the javascript code as a valid token.

This patch adds a check if the token is expired as well.

peterpeterparker commented 4 years ago

Thx for the PR 👍

It makes sense specially for login!

Could you also improve the iOS code? If I'm not wrong, expired isn't check there too.

blackwolf12333 commented 4 years ago

I'll have a look friday, didn't experience any issues there though.

peterpeterparker commented 4 years ago

Cool, keep me posted!

blackwolf12333 commented 4 years ago

As far as I can see the iOS sdk does allow the current access token to be null, also the plugin code calls FBSDKAccessToken refreshCurrentAccessToken before attempting to login. So I think the token will never be expired?

peterpeterparker commented 4 years ago

That works for me. Merged and release (v6.4.0).

Thx for the PR @blackwolf12333

nuno commented 4 years ago

on iOS for some reason if I have the FB native app installed I can't login anymore. I tested on simulator and works just fine, means that open the web modal login.

But if the Native modal login open with text : You already initialized a session on facebook, you want continue?

Wondering if I have something wrong.