fix: update Google OAuth redirect URI to use configuration setting

pull/10/head
David Montero Crespo 2026-03-06 20:53:54 -03:00
parent 7260c8d092
commit 6eefaf72db
2 changed files with 4 additions and 2 deletions

View File

@ -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",
},
)

View File

@ -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