diff --git a/surfsense_backend/.env.example b/surfsense_backend/.env.example index dfb7db8..5d4417f 100644 --- a/surfsense_backend/.env.example +++ b/surfsense_backend/.env.example @@ -9,6 +9,7 @@ AUTH_TYPE=GOOGLE or LOCAL GOOGLE_OAUTH_CLIENT_ID=924507538m GOOGLE_OAUTH_CLIENT_SECRET=GOCSV GOOGLE_CALENDAR_REDIRECT_URI=http://localhost:8000/api/v1/auth/google/calendar/connector/callback +GOOGLE_GMAIL_REDIRECT_URI=http://localhost:8000/api/v1/auth/google/gmail/connector/callback # Embedding Model EMBEDDING_MODEL=mixedbread-ai/mxbai-embed-large-v1 diff --git a/surfsense_backend/app/app.py b/surfsense_backend/app/app.py index 17f9082..1766c0c 100644 --- a/surfsense_backend/app/app.py +++ b/surfsense_backend/app/app.py @@ -1,3 +1,9 @@ +import os + +os.environ["OAUTHLIB_RELAX_TOKEN_SCOPE"] = ( + "1" # It is to disbale the error "Invalid token scope" when using Google OAuth with increemental scopes +) + from contextlib import asynccontextmanager from fastapi import Depends, FastAPI diff --git a/surfsense_backend/app/config/__init__.py b/surfsense_backend/app/config/__init__.py index 38a1f3e..38ae616 100644 --- a/surfsense_backend/app/config/__init__.py +++ b/surfsense_backend/app/config/__init__.py @@ -51,6 +51,9 @@ class Config: # Google Calendar redirect URI GOOGLE_CALENDAR_REDIRECT_URI = os.getenv("GOOGLE_CALENDAR_REDIRECT_URI") + # Google Gmail redirect URI + GOOGLE_GMAIL_REDIRECT_URI = os.getenv("GOOGLE_GMAIL_REDIRECT_URI") + # LLM instances are now managed per-user through the LLMConfig system # Legacy environment variables removed in favor of user-specific configurations