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).
In cases where the
refresh_token
is depleted while still bound to a user object, the library raises aNotFound
error due to the oldrefresh_token
not being found by the API server. This means the user object needs to be re-fetched to get the currentrefresh_token
. To re-fetch intelligently would be difficult, especially since remainingrefresh_token
uses may not be visible to the client.I suggest adding a
refetch
method toUser
so that therefresh_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).