@arnaudw38/nodebb-plugin-spam-be-gone 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/package.json +1 -1
- package/public/js/scripts.js +5 -9
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.0.5] - 2026-02-25
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- Fixed Turnstile not resetting after a failed login attempt when retrying on the same page.
|
|
9
|
+
- Reset is now triggered after login submit if the user remains on the login page, even if the hidden Turnstile token input has already been cleared by client-side login logic.
|
|
10
|
+
|
|
11
|
+
## [1.0.4] - 2026-02-25
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
- Fixed login UX regression where the Turnstile widget was resetting while typing in the username/password fields.
|
|
15
|
+
- Turnstile now resets only after a login submission retry flow (failed login without page reload), not on every keystroke.
|
|
16
|
+
|
|
5
17
|
## [1.0.3] - 2026-02-25
|
|
6
18
|
|
|
7
19
|
### Fixed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arnaudw38/nodebb-plugin-spam-be-gone",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Anti-spam plugin for NodeBB 4.x using Akismet, StopForumSpam API, ProjectHoneyPot, and Cloudflare Turnstile (Turnstile-only fork)",
|
|
5
5
|
"main": "library.js",
|
|
6
6
|
"scripts": {},
|
package/public/js/scripts.js
CHANGED
|
@@ -60,9 +60,10 @@ $(function () {
|
|
|
60
60
|
if (!document.getElementById(targetId)) {
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
|
-
if
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
// Reset unconditionally if we're still on the login page after submit.
|
|
64
|
+
// Tokens are single-use and may already have been cleared by the form logic
|
|
65
|
+
// when a login attempt fails, so checking the hidden input is unreliable.
|
|
66
|
+
resetTurnstileWidget(targetId);
|
|
66
67
|
}, delay);
|
|
67
68
|
});
|
|
68
69
|
}
|
|
@@ -82,12 +83,7 @@ $(function () {
|
|
|
82
83
|
.on('click.spamBeGoneTurnstileLogin', '[component="login/submit"]', function () {
|
|
83
84
|
scheduleLoginTurnstileReset(targetId);
|
|
84
85
|
})
|
|
85
|
-
.off('input.spamBeGoneTurnstileLogin change.spamBeGoneTurnstileLogin')
|
|
86
|
-
.on('input.spamBeGoneTurnstileLogin change.spamBeGoneTurnstileLogin', 'input[name="username"], input[name="password"]', function () {
|
|
87
|
-
if (document.getElementById(targetId) && getCurrentTurnstileResponse()) {
|
|
88
|
-
resetTurnstileWidget(targetId);
|
|
89
|
-
}
|
|
90
|
-
});
|
|
86
|
+
.off('input.spamBeGoneTurnstileLogin change.spamBeGoneTurnstileLogin');
|
|
91
87
|
}
|
|
92
88
|
|
|
93
89
|
function renderTurnstileIfNeeded(isLoginPage) {
|