Andre0512 / lidl-plus

Fetch receipts and more from Lidl Plus
MIT License
81 stars 19 forks source link

Cannot get refresh-token #2

Closed zsocap closed 1 year ago

zsocap commented 1 year ago

After adding .items() inside the _register_link function in lidlplus/api.py here:

kép

I was able to navigate to the page, but after providing the e-mail and password, then hitting the next button nothing happened:

kép

Andre0512 commented 1 year ago

Hi, which country and language do you use? Than I try to reproduce it later, only tested german so far 😅

zsocap commented 1 year ago

Hi there, I used the following setup:

lidl = LidlPlusApi(language="HU", country="hu")

It seems like the valid setup for Hungary.

Andre0512 commented 1 year ago

Problem should be fixed now, I created a new release. Sorry, v0.2.1 couldn't run, I had to test the releases more careful :facepalm:

zsocap commented 1 year ago

Thx very much for the update!

May I ask you what should happen after you hit the submit button? I receive the following pop-up:

image

Even if I put a break point to avoid the TimeoutException with the "Wrong credentials" message, and accept this pop-up manually, the submit button doesn't do anything.

I am using ubuntu 20.04, with chrome. Tried it win 10, firefox, chrome as well, but it was the same.

Andre0512 commented 1 year ago

Oh I see, this message pops up when the authentication is successful, but my code is waiting here for the two factor authentication. I thought it's required to have a 2fa, but maybe it's just required for german accounts or when you configure the payment option. I will make the 2fa optional and publish a new release this evening.

zsocap commented 1 year ago

Ahhh, got it! So basically you get the token from the latest request's header data and I just have to skip this part:

image

I was able to get the token and use it to get my tickets.

Checked my account on the phone, but I wasn't able to find anything related to 2fa. Maybe in Germany there are more options, e.g. online shopping and other functionalities that require more secure authentication. Thx for the help!!

Andre0512 commented 1 year ago

Yes, that's it! In Germany you can connect your bank account and automatically pay with it. I remember it was in the news that there was an abuse problem with this. Probably that's why 2fa is forced. Thanks for your contribution :)