Asynchronous JSON login — works with Fetch API, jQuery AJAX, XHR, or any HTTP client.
Form submission is intercepted by ajax.js. Credentials are posted as a JSON body — the HTTP client does not matter, only the JSON contract and the credentials: 'include' flag for cookie handling. On success the server returns a redirect URL; on failure an inline warning is shown without leaving the page.
resellerCode and username are saved in localStorage and pre-filled on the next visit.
Request
/reseller/auth/
application/json
{
"resellerCode": "...",
"username": "...",
"password": "..."
}
Response
{
"success": true,
"redirect": "https://..."
}
{
"success": false,
"message": "Invalid credentials"
}
.catch()
CORS requirements
Because this request uses credentials: 'include', the server must respond with both headers — the wildcard * is explicitly forbidden when credentials are involved:
Access-Control-Allow-Origin: <exact-origin>Access-Control-Allow-Credentials: trueConfigure the landing page origin in IRIX under Application CORS. Without it the browser silently blocks the response before your code sees it — a network error with no status code.
References