From 3852b028d1b3ab0124050bb46ed8fccb6a4af00a Mon Sep 17 00:00:00 2001 From: STACIA <69411527+staciax@users.noreply.github.com> Date: Sat, 18 Jun 2022 16:04:32 +0700 Subject: [PATCH] fixed cookie can't refresh_token --- bot.py | 2 +- utils/valorant/auth.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index 99d207e..13b4f64 100644 --- a/bot.py +++ b/bot.py @@ -36,7 +36,7 @@ class ValorantBot(commands.Bot): def __init__(self) -> None: super().__init__(command_prefix=BOT_PREFIX, case_insensitive=True, intents=intents) - self.bot_version = '3.2.0' + self.bot_version = '3.2.1' self.tree.interaction_check = self.interaction_check @staticmethod diff --git a/utils/valorant/auth.py b/utils/valorant/auth.py index fb7a659..eaff7ab 100644 --- a/utils/valorant/auth.py +++ b/utils/valorant/auth.py @@ -263,11 +263,13 @@ async def redeem_cookies(self, cookies: Dict) -> Tuple[Dict[str, Any], str, str] # cookies = json.loads(cookies) session = ClientSession() + + if 'cookie' in cookies: cookies = cookies['cookie'] async with session.get( "https://auth.riotgames.com/authorize?redirect_uri=https%3A%2F%2Fplayvalorant.com%2Fopt_in&client_id=play-valorant-web-prod&response_type=token%20id_token&scope=account%20openid&nonce=1", cookies=cookies, - allow_redirects=False + allow_redirects=False, ) as r: data = await r.text()