Skip to content

Commit

Permalink
Warn users about cookies expiry
Browse files Browse the repository at this point in the history
  • Loading branch information
Simatwa committed Dec 23, 2023
1 parent e0a71ab commit 62f4e28
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions WebChatGPT/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ def get_request_headers_and_append_auth(self) -> dict:
+ __common_error_support_info
)
self.auth = resp.json()
if self.auth.get("error"):
raise Exception(
"Your cookies have expired, login to `chat.openai.com` and then export new ones."
)
auth_template = headers["Authorization"]
headers["Authorization"] = auth_template % {"value": self.auth["accessToken"]}
return headers
Expand Down

0 comments on commit 62f4e28

Please sign in to comment.