chore: enhance environment configuration for frontend and Google authentication
- Add VITE_API_URL to docker-compose for frontend service. - Introduce FRONTEND_URL in backend environment files for redirection after Google login. - Update Google authentication router to use dynamic FRONTEND_URL for redirects.
This commit is contained in:
@@ -13,6 +13,7 @@ GOOGLE_CLIENT_ID = os.getenv("GOOGLE_CLIENT_ID")
|
||||
GOOGLE_CLIENT_SECRET = os.getenv("GOOGLE_CLIENT_SECRET")
|
||||
REDIRECT_URI = os.getenv("GOOGLE_REDIRECT_URI")
|
||||
SECRET_KEY = os.getenv("SECRET_KEY")
|
||||
FRONTEND_URL = os.getenv("FRONTEND_URL", "http://localhost:5173")
|
||||
|
||||
@router.get("/login")
|
||||
async def google_login():
|
||||
@@ -97,4 +98,4 @@ async def google_callback(request: Request):
|
||||
{"$set": {"token": token}}
|
||||
)
|
||||
|
||||
return RedirectResponse(f"http://localhost:5173/login?token={token}")
|
||||
return RedirectResponse(f"{FRONTEND_URL}/login?token={token}")
|
||||
Reference in New Issue
Block a user