Fix google auth url backend now
This commit is contained in:
parent
2c5668d21e
commit
40f264a08a
@ -113,7 +113,8 @@ def search_guests(
|
|||||||
# Google OAuth configuration
|
# Google OAuth configuration
|
||||||
GOOGLE_CLIENT_ID = os.getenv("GOOGLE_CLIENT_ID")
|
GOOGLE_CLIENT_ID = os.getenv("GOOGLE_CLIENT_ID")
|
||||||
GOOGLE_CLIENT_SECRET = os.getenv("GOOGLE_CLIENT_SECRET")
|
GOOGLE_CLIENT_SECRET = os.getenv("GOOGLE_CLIENT_SECRET")
|
||||||
GOOGLE_REDIRECT_URI = "http://localhost:8000/auth/google/callback"
|
GOOGLE_REDIRECT_URI = os.getenv("GOOGLE_REDIRECT_URI", "http://localhost:8000/auth/google/callback")
|
||||||
|
FRONTEND_URL = os.getenv("FRONTEND_URL", "http://localhost:5173")
|
||||||
|
|
||||||
# Google OAuth endpoints
|
# Google OAuth endpoints
|
||||||
@app.get("/auth/google")
|
@app.get("/auth/google")
|
||||||
@ -179,13 +180,13 @@ async def google_callback(code: str, db: Session = Depends(get_db)):
|
|||||||
|
|
||||||
# Redirect back to frontend with success message
|
# Redirect back to frontend with success message
|
||||||
return RedirectResponse(
|
return RedirectResponse(
|
||||||
url=f"http://localhost:5173?imported={imported_count}&owner={owner}",
|
url=f"{FRONTEND_URL}?imported={imported_count}&owner={owner}",
|
||||||
status_code=302
|
status_code=302
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
# Redirect back with error
|
# Redirect back with error
|
||||||
return RedirectResponse(
|
return RedirectResponse(
|
||||||
url=f"http://localhost:5173?error={str(e)}",
|
url=f"{FRONTEND_URL}?error={str(e)}",
|
||||||
status_code=302
|
status_code=302
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user