Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

403 on token refresh #115

Closed
tomdoo opened this issue Nov 13, 2021 · 26 comments
Closed

403 on token refresh #115

tomdoo opened this issue Nov 13, 2021 · 26 comments

Comments

@tomdoo
Copy link

tomdoo commented Nov 13, 2021

Hello
I still have a 403 error with the last version after the PR for #112 and #113

toogoodtogo-watcher_1  | Error during request:
toogoodtogo-watcher_1  | POST https://apptoogoodtogo.com/api/auth/v2/loginByEmail
toogoodtogo-watcher_1  | {
toogoodtogo-watcher_1  |     "device_type": "UNKNOWN",
toogoodtogo-watcher_1  |     "email": "*****",
toogoodtogo-watcher_1  |     "password": "*****"
toogoodtogo-watcher_1  | }
toogoodtogo-watcher_1  | 
toogoodtogo-watcher_1  | HTTPError: Response code 403 (Forbidden)
toogoodtogo-watcher_1  |     at Request.<anonymous> (/home/node/app/node_modules/got/dist/source/as-promise/index.js:117:42)
toogoodtogo-watcher_1  |     at processTicksAndRejections (internal/process/task_queues.js:95:5)

When I try to POST on Insomnia I obtain this response asking me to resolve a captcha

<html><head><title>apptoogoodtogo.com</title><style>#cmsg{animation: A 1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style></head><body style="margin:0"><p id="cmsg">Please enable JS and disable any ad blocker</p><script>var dd={'cid':'AHrlqAAAAAMANoQuwp2NxI8ATZMnzg==','hsh':'1D42C2CA6131C526E09F294FE96F94','t':'fe','r':'b','s':35702,'host':'geo.captcha-delivery.com'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>

Maybe we can re-open #114?

@VeslavG
Copy link

VeslavG commented Nov 13, 2021

same here, something is off with captcha returning

@MaxWinterstein
Copy link

yeah, login process is still broken for me too, i guess this only fixes fetching items when there is a valid session available

@unixfox
Copy link
Contributor

unixfox commented Nov 13, 2021

I found that toogoodtoogo may ban your IP if you used node-toogoodtogo-watcher before on the same IP, using a fresh new IP solve the issue.
And with a new fresh IP it can login without a valid session.

@AntoineCardon
Copy link

I found that toogoodtoogo may ban your IP if you used node-toogoodtogo-watcher before on the same IP, using a fresh new IP solve the issue. And with a new fresh IP it can login without a valid session.

Right (tested on my dedicated), unfortunatly, i used it on Docker from my NAS, i have fiber, with fix IP (even when i reboot router :( )

@jfadeuilhe
Copy link

I am in fiber with fixed IP too, and changing IP would not be trivial because it is accredited for my teleworking activity ...

Can we just hope that the address will be released in ... days / month / years ?

@MaxWinterstein
Copy link

wow, I was wrong. Did not realize that in fact my ipv4 address was burned, and my v6 is fine.

Tried to 'unblock' my v4 by passing valid cookies datadome around, but did not win against them (yet)...

@jfadeuilhe
Copy link

Switching to version 3.7.0 this morning: it works!

Phew, I'm not going to need to get my IP released (I was trying to contact them via a friend of the neighbor's daughter, that's my desperation)

Thank you !

@Fratorhe
Copy link

I still get the same error with 3.7.0.
Do you think it is the IP?

Error during request:
POST https://apptoogoodtogo.com/api/auth/v2/token/refresh
{
    "refresh_token": "TOKEN"
}

HTTPError: Response code 403 (Forbidden)
    at Request.<anonymous> (/usr/lib/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/as-promise/index.js:117:42)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

@navimondo
Copy link

navimondo commented Nov 14, 2021 via email

@andrzejpodgorny
Copy link

andrzejpodgorny commented Nov 14, 2021

Hello I still have a 403 error with the last version after the PR for #112 and #113

toogoodtogo-watcher_1  | Error during request:
toogoodtogo-watcher_1  | POST https://apptoogoodtogo.com/api/auth/v2/loginByEmail
toogoodtogo-watcher_1  | {
toogoodtogo-watcher_1  |     "device_type": "UNKNOWN",
toogoodtogo-watcher_1  |     "email": "*****",
toogoodtogo-watcher_1  |     "password": "*****"
toogoodtogo-watcher_1  | }
toogoodtogo-watcher_1  | 
toogoodtogo-watcher_1  | HTTPError: Response code 403 (Forbidden)
toogoodtogo-watcher_1  |     at Request.<anonymous> (/home/node/app/node_modules/got/dist/source/as-promise/index.js:117:42)
toogoodtogo-watcher_1  |     at processTicksAndRejections (internal/process/task_queues.js:95:5)

When I try to POST on Insomnia I obtain this response asking me to resolve a captcha

<html><head><title>apptoogoodtogo.com</title><style>#cmsg{animation: A 1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style></head><body style="margin:0"><p id="cmsg">Please enable JS and disable any ad blocker</p><script>var dd={'cid':'AHrlqAAAAAMANoQuwp2NxI8ATZMnzg==','hsh':'1D42C2CA6131C526E09F294FE96F94','t':'fe','r':'b','s':35702,'host':'geo.captcha-delivery.com'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>

Maybe we can re-open #114?

Have You tried connecting to different ip address?

@navimondo
Copy link

navimondo commented Nov 14, 2021 via email

@dennisvanderpool
Copy link
Contributor

I'm having the same issue, going to check the device_type as mentioend by @navimondo

@dennisvanderpool
Copy link
Contributor

device_type ANDROID did not work for me, should that be part of the config.json file?
image

@dennisvanderpool
Copy link
Contributor

@andrzejpodgorny Thanks, will try that one

@dennisvanderpool
Copy link
Contributor

dennisvanderpool commented Nov 14, 2021

@navimondo @andrzejpodgorny That one worked, I will create PR

@dennisvanderpool
Copy link
Contributor

Created PR #116

@jfadeuilhe
Copy link

Alright, I spoke too fast, it only worked for one day :

Error during request:
POST https://apptoogoodtogo.com/api/auth/v2/token/refresh
{
"refresh_token": "e30.eyJzdWI.../...wOjAifAkxBgHbNn77hU"
}

HTTPError: Response code 403 (Forbidden)
at Request. (/usr/local/lib/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/as-promise/index.js:117:42)
at processTicksAndRejections (internal/process/task_queues.js:97:5)

hopeless

@TGTGbot
Copy link

TGTGbot commented Nov 16, 2021

I am having the same problem.

@andrzejpodgorny
Copy link

This bot works for me. The changes I made are: Change this line:

device_type: "UNKNOWN",

to:
device_type: credentials.device_type
and place in your config.json this:

{
        "api": {
                "credentials": {
                        "device_type": "IOS",
                        "email": "xxxxxxxxx",

I know it can be done nicer, in a more programmatic way, but I don't want to change it anymore :)

@ghost
Copy link

ghost commented Nov 16, 2021

@andrzejpodgorny
Unfortunately that didn't work for me.
If I log into the app manually, I have to confirm the login by email.

@sbx59
Copy link

sbx59 commented Nov 16, 2021

image
he makes sure it's not a BOT with a captcha

@sbx59
Copy link

sbx59 commented Nov 16, 2021

the developer, can get inspired can be here: https://github.com/MoterHaker/bypass-captcha-examples

@Fratorhe With IP modify via connection sharing same problem (dynamic ip)

@marklagendijk
Copy link
Owner

I won't accept any CATPCHA-bypassing PRs, please see #118.

@sbx59
Copy link

sbx59 commented Nov 16, 2021

here it bypasses by generating a token. :

ahivert/tgtg-python#119

@marklagendijk
Copy link
Owner

here it bypasses by generating a token. :

ahivert/tgtg-python#119

No, he just implemented using the refresh token. This application already used that from the start.

@tomdoo
Copy link
Author

tomdoo commented Nov 17, 2021

Last version solved this issue for me. Thanks.

The last 3 days my tgtg-watcher was complety shutted down, maybe my IP is released for a couple of hours.
I also noticed everybody at home had to enter captcha's on other apps or websites.

If there is a new captcha issue, see #118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests