fix(ifta): 'I already filed' link must use the API host, not the site host

The handler is an API route; performancewest.net/api/* proxies to the Astro site
(:4322), only api.performancewest.net serves the API. Build the filed link from
PUBLIC_API_URL (default https://api.performancewest.net). Verified end-to-end:
valid token -> 200 confirmation page, invalid -> 403.
This commit is contained in:
justin 2026-06-13 23:49:05 -05:00
parent 3d4226e95c
commit 2b361a83a8

View file

@ -176,7 +176,10 @@ def _ifta_filed_token(dot: str) -> str:
def _filed_link(dot: str) -> str:
return f"{tc.SITE_DOMAIN}/api/v1/ifta/filed?dot={dot}&t={_ifta_filed_token(dot)}"
# The "I already filed" handler is an API route, so it must hit the API host
# (api.performancewest.net), NOT the Astro site host (performancewest.net).
api_base = os.getenv("PUBLIC_API_URL", "https://api.performancewest.net").rstrip("/")
return f"{api_base}/api/v1/ifta/filed?dot={dot}&t={_ifta_filed_token(dot)}"
def main() -> int: