diff --git a/backend/app/api/routes/auth.py b/backend/app/api/routes/auth.py index 1155286..aa44603 100644 --- a/backend/app/api/routes/auth.py +++ b/backend/app/api/routes/auth.py @@ -90,7 +90,7 @@ async def google_login(): raise HTTPException(status_code=501, detail="Google OAuth not configured.") params = { "client_id": settings.GOOGLE_CLIENT_ID, - "redirect_uri": f"{settings.FRONTEND_URL.rstrip('/')}/api/auth/google/callback", + "redirect_uri": settings.GOOGLE_REDIRECT_URI, "response_type": "code", "scope": "openid email profile", "access_type": "offline", @@ -112,7 +112,7 @@ async def google_callback(code: str, response: Response, db: AsyncSession = Depe "code": code, "client_id": settings.GOOGLE_CLIENT_ID, "client_secret": settings.GOOGLE_CLIENT_SECRET, - "redirect_uri": f"{settings.FRONTEND_URL.rstrip('/')}/api/auth/google/callback", + "redirect_uri": settings.GOOGLE_REDIRECT_URI, "grant_type": "authorization_code", }, ) diff --git a/backend/app/core/config.py b/backend/app/core/config.py index a33d0c3..833a3a8 100644 --- a/backend/app/core/config.py +++ b/backend/app/core/config.py @@ -4,8 +4,10 @@ from pydantic_settings import BaseSettings class Settings(BaseSettings): SECRET_KEY: str = "change-me-in-production-use-a-long-random-string" DATABASE_URL: str = "sqlite+aiosqlite:///./velxio.db" + DATA_DIR: str = "." GOOGLE_CLIENT_ID: str = "" GOOGLE_CLIENT_SECRET: str = "" + GOOGLE_REDIRECT_URI: str = "http://localhost:8001/api/auth/google/callback" FRONTEND_URL: str = "http://localhost:5173" ACCESS_TOKEN_EXPIRE_MINUTES: int = 10080 # 7 days