ahivert / tgtg-python

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

Refactor Login to Support Manual Polling #307

Open SuperLanceur opened 3 months ago

SuperLanceur commented 3 months ago

When using this as a library, it will allow a more flexible login process by separating the polling ID retrieval from the automatic polling. You can now call request_polling_id to get the polling ID, wait for the user to click the link in the email, and then call complete_login_with_polling_id with the polling ID to obtain the tokens. This change maintains backward compatibility by using these new methods within the existing login method.

Related to issue #306

ahivert commented 1 month ago

Thanks @SuperLanceur ! Can you update the readme with this new way of handling login ?

SuperLanceur commented 2 weeks ago

Done @ahivert ! The README now explains how to login in this way.