Skip to content

Commit 88edc73

Browse files
committed
fix(web/main): remove the success interstitial
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 <[email protected]>
1 parent f5b3bf8 commit 88edc73

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

docs/docs/CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
- Determine the `BIND_NETWORK`/`--bind-network` value from the bind address ([#677](https://github.com/TecharoHQ/anubis/issues/677)).
1515
- Implement localization system. Find locale files in lib/localization/locales/.
1616
- Implement a [development container](https://containers.dev/) manifest to make contributions easier.
17-
- Fix dynamic cookie domains functionality ([#731](https://github.com/TecharoHQ/anubis/pull/731))
18-
- Add option for custom cookie prefix ([#732](https://github.com/TecharoHQ/anubis/pull/732))
17+
- Fix dynamic cookie domains functionality ([#731](https://github.com/TecharoHQ/anubis/pull/731)).
18+
- Add option for custom cookie prefix ([#732](https://github.com/TecharoHQ/anubis/pull/732)).
19+
- Remove the "Success" interstitial after a proof of work challenge is concluded.
1920

2021
## v1.20.0: Thancred Waters
2122

web/js/main.mjs

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,6 @@ const t = (key) => translations[`js_${key}`] || translations[key] || key;
212212
const t1 = Date.now();
213213
console.log({ hash, nonce });
214214

215-
title.innerHTML = t('success');
216-
status.innerHTML = `${t('done_took')} ${t1 - t0}ms, ${nonce} ${t('iterations')}`;
217-
image.src = imageURL("happy", anubisVersion, basePrefix);
218-
progress.style.display = "none";
219-
220215
if (userReadDetails) {
221216
const container = document.getElementById("progress");
222217

@@ -251,17 +246,15 @@ const t = (key) => translations[`js_${key}`] || translations[key] || key;
251246
container.onclick = onDetailsExpand;
252247
setTimeout(onDetailsExpand, 30000);
253248
} else {
254-
setTimeout(() => {
255-
const redir = window.location.href;
256-
window.location.replace(
257-
u(`${basePrefix}/.within.website/x/cmd/anubis/api/pass-challenge`, {
258-
response: hash,
259-
nonce,
260-
redir,
261-
elapsedTime: t1 - t0,
262-
}),
263-
);
264-
}, 250);
249+
const redir = window.location.href;
250+
window.location.replace(
251+
u(`${basePrefix}/.within.website/x/cmd/anubis/api/pass-challenge`, {
252+
response: hash,
253+
nonce,
254+
redir,
255+
elapsedTime: t1 - t0,
256+
}),
257+
);
265258
}
266259
} catch (err) {
267260
ohNoes({

0 commit comments

Comments
 (0)