SynapseFI / SynapseFI-Python

SynapseFI Python API Wrapper
11 stars 13 forks source link

refresh_token not found #27

Closed stevula closed 7 years ago

stevula commented 7 years ago

In cases where the refresh_token is depleted while still bound to a user object, the library raises a NotFound error due to the old refresh_token not being found by the API server. This means the user object needs to be re-fetched to get the current refresh_token. To re-fetch intelligently would be difficult, especially since remaining refresh_token uses may not be visible to the client.

I suggest adding a refetch method to User so that the refresh_token can at least be updated manually / through an error-handling process without generating a new User object. Refetching before each authenticated request would also work but may not be worth the increased number of requests (we are already POSTing to OAuth on each authenticated request, which I'd like to cut down on).

stevula commented 7 years ago

rendered moot by #27 I think. might still be nice to have a refresh_data method or something.