July 3rd - Update landing page

This commit is contained in:
2026-07-03 15:38:31 -04:00
parent 4c275fc0e5
commit 4b6401be43
12 changed files with 414 additions and 19 deletions
+17 -1
View File
@@ -57,6 +57,8 @@ def _is_exempt(path):
return True
if path.startswith('/signup'):
return True # public self-service signup has no tenant context
if path.startswith('/welcome'):
return True # public marketing/landing page has no tenant context
if path.startswith('/notifications/trial-reminders'):
return True # cross-tenant cron — iterates all tenants from control DB
if path.startswith('/notifications/dunning-reminders'):
@@ -74,6 +76,7 @@ def init_tenancy(app):
g.tenant = None
g.tenant_engine = None
g.billing_warning = None # MT-8: set to 'past_due' by _billing_gate when needed
g.is_apex = False # True when serving the public apex/landing host
if not current_app.config.get('MULTI_TENANT_ENABLED', False):
return # inert: default database serves everything (single-tenant)
@@ -124,8 +127,21 @@ def init_tenancy(app):
session.pop('impersonating_tenant_id', None)
session.pop('impersonating_superadmin_id', None)
# ── Normal Host → tenant resolution ──────────────────────────────
# ── Apex (marketing) host → public landing page ──────────────────
# The apex domain (jqc.app) and its www. variant are NOT tenants. Serve
# the public landing page for '/' and send any other non-exempt apex
# path back to it. /signup, /static, /welcome are already exempt above.
host = (request.host or '').split(':')[0].strip().lower()
base = (current_app.config.get('TENANT_BASE_DOMAIN') or '').strip().lower()
if base and host in (base, f'www.{base}'):
g.is_apex = True
if request.path == '/':
# Serve the landing view without a redirect (dashboard owns '/'
# on tenant hosts, so we can't register a second '/' route).
return current_app.view_functions['landing.index']()
return redirect('/')
# ── Normal Host → tenant resolution ──────────────────────────────
tenant = resolve_tenant(host)
if tenant is None:
return Response(_UNKNOWN_TENANT_PAGE, status=404, mimetype='text/html')