ahivert / tgtg-python

Unofficial client for TooGoodToGo API
GNU General Public License v3.0
377 stars 73 forks source link

refresh token #223

Closed jakmanne closed 1 year ago

jakmanne commented 1 year ago

Would it be possible to use the refresh token to get a new access token? With the current setup I have to manually go to my email to confirm the login everytime, but is it possible to only do this one time, and then let the refresh token get a new access token?

Ed-Infrared commented 1 year ago

After you initial login wich you have confirmed in you email, you get the tokens but also a cookie. When you store the cookie and use it the next time you don't have to confirm with email.

tgtg_client = TgtgClient(access_token="<your token>, refresh_token= <your token>, user_id=<your id>, cookie=<your cookie>)

jakmanne commented 1 year ago

Thanks for reply @Ed-Infrared . Does this mean that the TgTgClient will be granted access indefinitely? Or does it require to once in a while to re-authenticate with the email ?

Great job with the project!

Ed-Infrared commented 1 year ago

@jakmanne : I am just another user of this great library. I am using this for 2 weeks and didn't have to renew my login yet even between reboots.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.