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:
parent
3d4226e95c
commit
2b361a83a8
1 changed files with 4 additions and 1 deletions
|
|
@ -176,7 +176,10 @@ def _ifta_filed_token(dot: str) -> str:
|
||||||
|
|
||||||
|
|
||||||
def _filed_link(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:
|
def main() -> int:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue