Fix: Better error handling for missing Google OAuth credentials
- Add .env.example with required environment variables - Add helpful warning message when google_client_id/secret are missing - Update steps_to_run.md with detailed setup instructions - Include instructions for creating Google OAuth credentials Addresses #9
This commit is contained in:
12
server/.env.example
Normal file
12
server/.env.example
Normal file
@@ -0,0 +1,12 @@
|
||||
# Flask Configuration
|
||||
FLASK_ENV=dev
|
||||
FLASK_APP=webserver.py
|
||||
SECRET_KEY=your-secret-key-here
|
||||
|
||||
# Google OAuth Credentials (for user authentication)
|
||||
# Get these from https://console.cloud.google.com/apis/credentials
|
||||
google_client_id=your-google-client-id
|
||||
google_client_secret=your-google-client-secret
|
||||
|
||||
# OpenAI API Key (users can also add this in the UI)
|
||||
# OPENAI_API_KEY=sk-your-openai-api-key
|
||||
@@ -25,8 +25,19 @@ scope = [
|
||||
"https://www.googleapis.com/auth/userinfo.profile",
|
||||
"openid"
|
||||
]
|
||||
google_client_id = os.environ['google_client_id']
|
||||
google_client_secret = os.environ['google_client_secret']
|
||||
google_client_id = os.environ.get('google_client_id')
|
||||
google_client_secret = os.environ.get('google_client_secret')
|
||||
|
||||
if not google_client_id or not google_client_secret:
|
||||
print("=" * 60)
|
||||
print("WARNING: Google OAuth credentials not found!")
|
||||
print("Please set the following environment variables:")
|
||||
print(" - google_client_id")
|
||||
print(" - google_client_secret")
|
||||
print("")
|
||||
print("Get these from: https://console.cloud.google.com/apis/credentials")
|
||||
print("See server/.env.example for reference.")
|
||||
print("=" * 60)
|
||||
word_limit = 50 # word limit for task brainstorming
|
||||
|
||||
rp = Blueprint('rp', __name__)
|
||||
|
||||
Reference in New Issue
Block a user