Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions surfsense_backend/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ def registration_allowed():
app.include_router(
fastapi_users.get_oauth_router(
google_oauth_client, auth_backend, SECRET, is_verified_by_default=True
)
if not config.BACKEND_URL
else fastapi_users.get_oauth_router(
google_oauth_client,
auth_backend,
SECRET,
is_verified_by_default=True,
redirect_url=f"{config.BACKEND_URL}/auth/google/callback",
),
prefix="/auth/google",
tags=["auth"],
Expand Down
2 changes: 2 additions & 0 deletions surfsense_backend/app/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ class Config:
DATABASE_URL = os.getenv("DATABASE_URL")

NEXT_FRONTEND_URL = os.getenv("NEXT_FRONTEND_URL")
# Backend URL to override the http to https in the OAuth redirect URI
BACKEND_URL = os.getenv("BACKEND_URL")

# Auth
AUTH_TYPE = os.getenv("AUTH_TYPE")
Expand Down
Loading