Agency Login

AJAX Login

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

POST /reseller/auth/ application/json
{
  "resellerCode": "...",
  "username": "...",
  "password": "..."
}

Response

200 login success application/json
{
  "success": true,
  "redirect": "https://..."
}
200 auth failure application/json
{
  "success": false,
  "message": "Invalid credentials"
}
4xx / 5xx network or server error — shown via .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: true

Configure 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