tomgross / pcloud

A Python implementation of the pCloud API
MIT License
94 stars 28 forks source link

Saving the auth code token between oauth2 calls. #71

Closed quistian closed 1 year ago

quistian commented 1 year ago

In testing it seems like each time one uses oauth2 e.g.

pc = PyCloud.oauth2_authorize(client_id=api_id, client_secret=api_secret)

There's a redirect and one has to login each time. E.g. the auth_token does not seem to get reused. I see it is printed out:

"GET /?code=abc123....123abc&locationid=1&hostname=api.pcloud.com "

Is there a way to save the token so it can be reused?

quistian commented 1 year ago

I've been able to modify your code to look for a local access token before going out the tokenhander. So all seems to be well.