giorgi-o / SkinPeek

Awesome Valorant Discord bot to see your daily shop, night market, battlepass progression, and much more
GNU General Public License v3.0
217 stars 91 forks source link

setCookie is not iterable - Cloudflare error 403/1020 #42

Closed mrdeadi02 closed 1 year ago

mrdeadi02 commented 2 years ago
mrdeadi#4616 used /login
Assertion failed: Auth Request Cookies status code is 403! {
  statusCode: 403,
  headers: {
    date: 'Thu, 16 Jun 2022 13:58:20 GMT',
    'content-type': 'text/plain; charset=UTF-8',
    'content-length': '16',
    connection: 'close',
    'x-frame-options': 'SAMEORIGIN',
    'referrer-policy': 'same-origin',
    'cache-control': 'private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0',
    expires: 'Thu, 01 Jan 1970 00:00:01 GMT',
    'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
    'x-riotgames-cdn': 'Cloudflare',
    'set-cookie': [
      '__cf_bm=Lg27LO1t2NnKPkSgz110bpS0KOZMiyXqkyAM0r8HUfA-1655387900-0-AeCpa5/sn/lfUQk4GXa+abbkcRAa5iKTMGKgpCMWCVbh8Nd4wfDwUuFGiYL8IbZoO5zAoVfdIO5qegmUAVO1CIM=; path=/; expires=Thu, 16-Jun-22 14:28:20 GMT; domain=.riotgames.com; HttpOnly; Secure; SameSite=None'
    ],
    server: 'cloudflare',
    'cf-ray': '71c40f4a8a629a33-FRA'
  },
  body: 'error code: 1020'
}
Assertion failed: Auth status code is 403! {
  statusCode: 403,
  headers: {
    date: 'Thu, 16 Jun 2022 13:58:20 GMT',
    'content-type': 'text/plain; charset=UTF-8',
    'content-length': '16',
    connection: 'close',
    'x-frame-options': 'SAMEORIGIN',
    'referrer-policy': 'same-origin',
    'cache-control': 'private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0',
    expires: 'Thu, 01 Jan 1970 00:00:01 GMT',
    'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
    'x-riotgames-cdn': 'Cloudflare',
    server: 'cloudflare',
    'cf-ray': '71c40f4acb7b9b40-FRA'
  },
  body: 'error code: 1020'
}
TypeError: setCookie is not iterable
    at parseSetCookie (file:///home/container/misc/util.js:106:25)
    at redeemUsernamePassword (file:///home/container/valorant/auth.js:89:12)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async queueUsernamePasswordLogin (file:///home/container/valorant/authQueue.js:17:58)
    at async loginUsernamePassword (file:///home/container/discord/authManager.js:11:17)
    at async Client.<anonymous> (file:///home/container/discord/bot.js:660:21)
giorgi-o commented 2 years ago

yeah, that's Rito strengthening their Cloudflare firewall again. Until I or someone finds another bypass, all you can do is wait or switch servers, as it seems to be based on the IP address.

giorgi-o commented 2 years ago

Just a quick note, Cloudflare seemed to have banned certain IP address ranges, for example Hetzner and Leaseweb. If you are hosting the bot on a VPS from a big company, chances are Cloudflare have blocked them too. Unfortunately, that means the only "bypass" in that case is to use a proxy or VPN.

sugoides commented 2 years ago

Any update on this one @giorgi-o, sorry for the ping, I'm hosting my bot at heroku

giorgi-o commented 2 years ago

Currently, the bot works. If you are using the latest version of the bot and still getting 1020'd, then they blocked your IP.

Also in case you didn't know, Heroku will stop offering their free plan soon, so you might want to start looking for an alternative.

giorgi-o commented 1 year ago

The admin guide wiki page has the most up-to-date information about this error.