From 9f0c5e974ee15a7424ef70c4d31e94d0a718f4ca Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Tue, 1 Jul 2025 23:44:38 +0000 Subject: [PATCH 1/2] fix(web/main): remove the success interstitial (#745) I'm gonna be totally honest here, I'm still not sure why #564 is still an issue. This is really confusing and I'm going to totally throw out how Anubis issues challenges and redo it with Valkey (#201, #622). The problem seems to be that I assume that the makeChallenge function in package lib is idempotent for the same client. I have no idea why this would be inconsistent, but for some reason it is and I'm just at a loss for words as to why this is happening. This stops the bleeding by improving the UX as a stopgap. Signed-off-by: Xe Iaso --- docs/docs/CHANGELOG.md | 5 +++-- web/js/main.mjs | 25 +++++++++---------------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/docs/docs/CHANGELOG.md b/docs/docs/CHANGELOG.md index a9394bc..b77ae99 100644 --- a/docs/docs/CHANGELOG.md +++ b/docs/docs/CHANGELOG.md @@ -17,8 +17,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Determine the `BIND_NETWORK`/`--bind-network` value from the bind address ([#677](https://github.com/TecharoHQ/anubis/issues/677)). - Implement localization system. Find locale files in lib/localization/locales/. - Implement a [development container](https://containers.dev/) manifest to make contributions easier. -- Fix dynamic cookie domains functionality ([#731](https://github.com/TecharoHQ/anubis/pull/731)) -- Add option for custom cookie prefix ([#732](https://github.com/TecharoHQ/anubis/pull/732)) +- Fix dynamic cookie domains functionality ([#731](https://github.com/TecharoHQ/anubis/pull/731)). +- Add option for custom cookie prefix ([#732](https://github.com/TecharoHQ/anubis/pull/732)). +- Remove the "Success" interstitial after a proof of work challenge is concluded. ## v1.20.0: Thancred Waters diff --git a/web/js/main.mjs b/web/js/main.mjs index 0b1e69b..9d0f192 100644 --- a/web/js/main.mjs +++ b/web/js/main.mjs @@ -212,11 +212,6 @@ const t = (key) => translations[`js_${key}`] || translations[key] || key; const t1 = Date.now(); console.log({ hash, nonce }); - title.innerHTML = t('success'); - status.innerHTML = `${t('done_took')} ${t1 - t0}ms, ${nonce} ${t('iterations')}`; - image.src = imageURL("happy", anubisVersion, basePrefix); - progress.style.display = "none"; - if (userReadDetails) { const container = document.getElementById("progress"); @@ -251,17 +246,15 @@ const t = (key) => translations[`js_${key}`] || translations[key] || key; container.onclick = onDetailsExpand; setTimeout(onDetailsExpand, 30000); } else { - setTimeout(() => { - const redir = window.location.href; - window.location.replace( - u(`${basePrefix}/.within.website/x/cmd/anubis/api/pass-challenge`, { - response: hash, - nonce, - redir, - elapsedTime: t1 - t0, - }), - ); - }, 250); + const redir = window.location.href; + window.location.replace( + u(`${basePrefix}/.within.website/x/cmd/anubis/api/pass-challenge`, { + response: hash, + nonce, + redir, + elapsedTime: t1 - t0, + }), + ); } } catch (err) { ohNoes({ From c981c23f7e344f22629e7aee43e001cbf6d3b913 Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Wed, 2 Jul 2025 05:25:10 +0000 Subject: [PATCH 2/2] chore: npm run generate Signed-off-by: Xe Iaso --- lib/challenge/metarefresh/metarefresh_templ.go | 2 +- web/index_templ.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/challenge/metarefresh/metarefresh_templ.go b/lib/challenge/metarefresh/metarefresh_templ.go index 172395a..c677a59 100644 --- a/lib/challenge/metarefresh/metarefresh_templ.go +++ b/lib/challenge/metarefresh/metarefresh_templ.go @@ -1,6 +1,6 @@ // Code generated by templ - DO NOT EDIT. -// templ: version: v0.3.898 +// templ: version: v0.3.906 package metarefresh //lint:file-ignore SA4006 This context is only used if a nested component is present. diff --git a/web/index_templ.go b/web/index_templ.go index ab9328b..0601ba2 100644 --- a/web/index_templ.go +++ b/web/index_templ.go @@ -1,6 +1,6 @@ // Code generated by templ - DO NOT EDIT. -// templ: version: v0.3.898 +// templ: version: v0.3.906 package web //lint:file-ignore SA4006 This context is only used if a nested component is present.