<html style="minHeight: 100%; position: relative">
<body style="height: 100vh; margin: 0">
<iframe id="xund-iframe" title="XUND Application Frame" style="width: 100%; height: 100%; overflow:scroll; border: none; margin:0 auto;"></iframe>
<script>
async function run() {
const authCode = crypto.randomUUID?.() ?? crypto.getRandomValues(new Uint32Array(40)).join('')
const xund_client_id="94ea3b4a-9e05-4c57-be5a-922dc248cdfb";
const xund_auth_base_url="https://login.xund.solutions/api";
const xund_state="29aadfdb-f0a0-244c-3fa9-67aa2715d9ca";
const xund_app_base_url="https://frame.webapp.class2.xund.solutions/c9e9faa0-7664-47b6-a62e-2482f2c1df76";
const xund_params="birth=1972-05-25&gender=male&state=29aadfdb-f0a0-244c-3fa9-67aa2715d9ca&directCheck=SYMPTOM_CHECK";
const response = await fetch(`${xund_auth_base_url}/authorize?clientId=${xund_client_id}&authCode=${authCode}&state=${xund_state}&scope=state`);
document.getElementById("xund-iframe").src = `${xund_auth_base_url}/token?clientId=${xund_client_id}&authCode=${authCode}&redirectUri=${encodeURIComponent(xund_app_base_url + "?" + xund_params)}`
}
run();
</script>
</body>
</html>