philippec / PhFacebook

MacOSX Interface to Facebook graph API
http://developer.casgrain.com/?p=107
Other
178 stars 44 forks source link

If an expired cached token is initialized, expiration time is ignored #24

Closed k7d closed 12 years ago

k7d commented 13 years ago

PhAuthenticationToken init method was setting token's expiry date to nil if secondsToExpiry was negative.

However PhFacebook.m is assuming that token is valid when expiry is nil:

if (_authToken.expiry == nil || [[_authToken.expiry laterDate: [NSDate date]] isEqual: _authToken.expiry])
    validToken = YES;
k7d commented 13 years ago

Just noticed this was introduced in pull request #16. So possibly this fix as-it-is may break something else... didn't have time to investigate yet. Maybe you have other ideas how to fix it?