feat(config): add APP_BASE_URL setting for outbound link construction
Some checks failed
Some checks failed
Adds app_base_url config (default http://localhost:8000) used for all outbound URLs: invitation emails, billing checkout redirects, signup login links, portal return URLs. Replaces hardcoded https://{main_domain} and localhost:8000 patterns. Configurable per environment via APP_BASE_URL env var: - Dev: http://localhost:8000 (or http://acme.localhost:9999) - Prod: https://wizard.lu main_domain is preserved for subdomain resolution and cookie config. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -144,7 +144,7 @@ def purchase_addon(
|
||||
store = billing_service.get_store(db, store_id)
|
||||
|
||||
# Build URLs
|
||||
base_url = f"https://{settings.main_domain}"
|
||||
base_url = settings.app_base_url.rstrip("/")
|
||||
success_url = f"{base_url}/store/{store.store_code}/billing?addon_success=true"
|
||||
cancel_url = f"{base_url}/store/{store.store_code}/billing?addon_cancelled=true"
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ def create_checkout_session(
|
||||
|
||||
store_code = subscription_service.get_store_code(db, store_id)
|
||||
|
||||
base_url = f"https://{settings.main_domain}"
|
||||
base_url = settings.app_base_url.rstrip("/")
|
||||
success_url = f"{base_url}/store/{store_code}/billing?success=true"
|
||||
cancel_url = f"{base_url}/store/{store_code}/billing?cancelled=true"
|
||||
|
||||
@@ -87,7 +87,7 @@ def create_portal_session(
|
||||
merchant_id, platform_id = subscription_service.resolve_store_to_merchant(db, store_id, current_user.token_platform_id)
|
||||
|
||||
store_code = subscription_service.get_store_code(db, store_id)
|
||||
return_url = f"https://{settings.main_domain}/store/{store_code}/billing"
|
||||
return_url = f"{settings.app_base_url.rstrip('/')}/store/{store_code}/billing"
|
||||
|
||||
result = billing_service.create_portal_session(db, merchant_id, platform_id, return_url)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user