Jesus / dropbox_api

Ruby client library for Dropbox API v2
MIT License
171 stars 113 forks source link

on_token_refreshed never trigger #104

Open fabiancarlos opened 5 months ago

fabiancarlos commented 5 months ago

I was testing using byebug on the block lambda, and try to save direct in database... but just not triggering

guycall commented 3 months ago

@fabiancarlos I get the same issue. If you inspect the access_token it thinks it is not expired:

access_token = OAuth2::AccessToken.from_hash(authenticator, token_hash)
puts "Access token expired? #{access_token.expired?}"

If you inspect the token returned from dropbox, it only has a "expires_in" field and no "expires_at". It appears OAuth2::AccessToken.from_hash generates "expires_at" if it is missing (i.e. now + expires_in)