diff options
| author | Ryan Cao <70191398+ryanccn@users.noreply.github.com> | 2025-04-18 04:06:37 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-18 00:06:37 -0400 |
| commit | f844dba3dcfc0c51bcc72bfe9707ceec0c09b7ed (patch) | |
| tree | dda8006379d358741d0d679c860cb0627b3b6090 /web/js/main.mjs | |
| parent | 736c3ade0944532690098c4f8a7fab0d92420a09 (diff) | |
| download | anubis-f844dba3dcfc0c51bcc72bfe9707ceec0c09b7ed.tar.xz anubis-f844dba3dcfc0c51bcc72bfe9707ceec0c09b7ed.zip | |
perf: embed challenge data in HTML (#279)
Diffstat (limited to 'web/js/main.mjs')
| -rw-r--r-- | web/js/main.mjs | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/web/js/main.mjs b/web/js/main.mjs index a093c74..9bb6031 100644 --- a/web/js/main.mjs +++ b/web/js/main.mjs @@ -133,19 +133,7 @@ function showContinueBar(hash, nonce, t0, t1) { } } - const { challenge, rules } = await fetch("/.within.website/x/cmd/anubis/api/make-challenge", { method: "POST" }) - .then(r => { - if (!r.ok) throw new Error("Failed to fetch config"); - return r.json(); - }) - .catch(err => { - ohNoes({ - titleMsg: "Internal error!", - statusMsg: `Failed to fetch challenge config: ${err.message}`, - imageSrc: imageURL("reject", anubisVersion), - }); - throw err; - }); + const { challenge, rules } = JSON.parse(document.getElementById('anubis_challenge').textContent); const process = algorithms[rules.algorithm]; if (!process) { |
