From f674d912398e2fa867bab914a43f4c0e99ca4e5c Mon Sep 17 00:00:00 2001 From: Fuwn Date: Tue, 25 Jul 2023 15:13:48 -0700 Subject: docs(index): refresh token functionality --- src/due/routes/index.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/due/routes/index.py b/src/due/routes/index.py index 545c640..e9e355c 100644 --- a/src/due/routes/index.py +++ b/src/due/routes/index.py @@ -21,6 +21,20 @@ def home(): response = redirect("/") response.set_cookie("hide_message", "1") + # print( + # requests.post( + # "https://anilist.co/api/v2/oauth/token", + # data={ + # "grant_type": "refresh_token", + # "client_id": os.getenv("ANILIST_CLIENT_ID"), + # "client_secret": os.getenv("ANILIST_CLIENT_SECRET"), + # "refresh_token": json.loads(request.cookies.get("anilist"))[ + # "refresh_token" + # ], + # }, + # ).json() + # ) + if request.cookies.get("anilist"): anilist = json.loads(request.cookies.get("anilist")) start = time.time() -- cgit v1.2.3