ryuseisan / auto-chatgpt

Automate interaction with the browser version of ChatGPT.
MIT License
54 stars 11 forks source link

Fix Google account login support #20

Closed ryuseisan closed 1 year ago

ryuseisan commented 1 year ago

This merge request aims to reintroduce the ability to log in using a Google account. This functionality was lost in commit 02fa7e5 due to refactoring. This MR provides a more flexible login process, accommodating users of both OpenAI and Google account types.

Main changes:

  1. Added ACCOUNT_TYPE=[OPENAI, GOOGLE] in env.example to choose whether to login with OpenAI account or Google account.
  2. Modified the login function in the code to handle both types of logins.

If ACCOUNT_TYPE is set to "OPENAI", the system logs in with OpenAI account details. If it's set to "GOOGLE", the system logs in with Google account details. If any other value is provided, the system throws a ValueError.