Skip to content

Commit 67cc662

Browse files
v3.0.5
Signed-off-by: Dinger <[email protected]>
1 parent 9b2add1 commit 67cc662

62 files changed

Lines changed: 73 additions & 50 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

backend_api_python/app/services/oauth_service.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,29 @@ def _load_config(self):
156156
self.github_redirect_uri = os.getenv('GITHUB_REDIRECT_URI', '')
157157
self.github_enabled = bool(self.github_client_id and self.github_client_secret)
158158

159-
# Frontend URL for redirect after OAuth
160-
self.frontend_url = os.getenv('FRONTEND_URL', 'http://localhost:8080')
159+
# Frontend URL for redirect after OAuth.
160+
#
161+
# FRONTEND_URL accepts a comma-separated list of origins (the same
162+
# convention used by CORS in `app/__init__.py`). This lets one backend
163+
# serve e.g. ai.quantdinger.com + m.quantdinger.com without forcing the
164+
# operator to also fill OAUTH_ALLOWED_REDIRECTS.
165+
#
166+
# The FIRST entry is the default post-login redirect target. Every
167+
# entry is added to the allow-list. If we ever stored the raw
168+
# comma-joined string as a single URL we'd build a redirect like
169+
# "https://a.example.com,https://b.example.com?oauth_token=..." and
170+
# the browser would land on a malformed page (see bug report
171+
# 2026-05-14: stray comma + missing colon in the second origin).
172+
raw_frontend = os.getenv('FRONTEND_URL', 'http://localhost:8080')
173+
frontend_list = [x.strip() for x in raw_frontend.split(',') if x.strip()]
174+
self.frontend_url = frontend_list[0] if frontend_list else 'http://localhost:8080'
161175

162176
# Allow-listed origins that may be used as post-login redirect targets
163-
# (comma-separated). FRONTEND_URL is always allowed.
177+
# (comma-separated). FRONTEND_URL entries are always allowed.
164178
raw_allowed = os.getenv('OAUTH_ALLOWED_REDIRECTS', '')
165179
extra = [x.strip() for x in raw_allowed.split(',') if x.strip()]
166180
self.allowed_redirect_origins = set()
167-
for item in [self.frontend_url] + extra:
181+
for item in frontend_list + extra:
168182
origin = self._normalize_origin(item)
169183
if origin:
170184
self.allowed_redirect_origins.add(origin)

backend_api_python/env.example

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@ ADMIN_EMAIL=
5656
# Core app
5757
# =========================
5858
DATABASE_URL=postgresql://quantdinger:quantdinger123@postgres:5432/quantdinger
59+
# FRONTEND_URL: the canonical user-facing URL of the web app.
60+
# - Used for: CORS allow-list, default post-login OAuth redirect target.
61+
# - Comma-separated multi-origin IS supported (the first entry is the
62+
# default OAuth redirect; every entry is added to the CORS / OAuth
63+
# allow-list). Prefer the simpler `OAUTH_ALLOWED_REDIRECTS` below for
64+
# the second / third front-end origin so that this stays a single URL.
65+
# Examples:
66+
# FRONTEND_URL=https://ai.quantdinger.com
67+
# FRONTEND_URL=https://ai.quantdinger.com,https://m.quantdinger.com
5968
FRONTEND_URL=http://localhost:8888
6069
# Extra front-end origins allowed as OAuth post-login redirect targets.
6170
# Comma-separated, scheme + host (+ optional port). Used when multiple clients

frontend/dist/css/19.7df7f2f4.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/dist/css/215.7df7f2f4.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/dist/css/245.b4d633d1.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/dist/css/327.217b04e6.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/dist/css/375.217b04e6.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/dist/css/645.d0b61cde.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

frontend/dist/css/650.826a601d.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

frontend/dist/css/712.b4d633d1.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)