diff --git a/client/homebrew/pages/errorPage/errorPage.jsx b/client/homebrew/pages/errorPage/errorPage.jsx index 387a99b02..0d9209404 100644 --- a/client/homebrew/pages/errorPage/errorPage.jsx +++ b/client/homebrew/pages/errorPage/errorPage.jsx @@ -5,9 +5,11 @@ const Markdown = require('../../../../shared/naturalcrit/markdown.js'); const ErrorIndex = require('./errors/errorIndex.js'); const ErrorPage = ({ brew })=>{ + // Retrieving the error text based on the brew's error code from ErrorIndex const errorText = ErrorIndex({ brew })[brew.HBErrorCode.toString()] || ''; - + console.log(errorText); + return (
diff --git a/client/homebrew/pages/errorPage/errors/errorIndex.js b/client/homebrew/pages/errorPage/errors/errorIndex.js index 7fa24dddc..2127af92c 100644 --- a/client/homebrew/pages/errorPage/errors/errorIndex.js +++ b/client/homebrew/pages/errorPage/errors/errorIndex.js @@ -147,6 +147,22 @@ const errorIndex = (props)=>{ **Brew ID:** ${props.brew.brewId} **Brew Title:** ${props.brew.brewTitle}`, + + '470' : dedent` + ## You have runned out of attempts + + You are trying to access the admin page, reserved for the administrators of this tool. + This is not a page where regular users should be, please, refrain from further access attempts. + + : + + If you are a part of the administrators team who does not remember the correct credentials, + please get in contact with the rest of the team before trying again. + + : + + In any case, your attempts have been logged, and you will not be capable of doing any more attempt for now. + `, }; }; diff --git a/package-lock.json b/package-lock.json index 8e41fc122..c26304dce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7255,14 +7255,6 @@ "node": ">=10.17.0" } }, - "node_modules/i": { - "version": "0.3.7", - "resolved": "https://registry.npmjs.org/i/-/i-0.3.7.tgz", - "integrity": "sha512-FYz4wlXgkQwIPqhzC5TdNMLSE5+GS1IIDJZY/1ZiEPCT2S3COUVZeT5OW4BmW4r5LHLQuOosSwsvnroG9GR59Q==", - "engines": { - "node": ">=0.4" - } - }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", diff --git a/server/admin.api.js b/server/admin.api.js index 8e0239dd4..45d342868 100644 --- a/server/admin.api.js +++ b/server/admin.api.js @@ -7,9 +7,9 @@ const rateLimit = require('express-rate-limit'); // Define rate limiter options const loginLimiter = rateLimit({ - timeWindow: 24 * 60 * 60 * 1000, // 24 hours window - max: 10, // limit each IP to 10 requests per timeWindow - message: "Too many login attempts from this IP, please try again later" + timeWindow : 24 * 60 * 60 * 1000, // 24 hours window + max : 10, // limit each IP to 10 requests per timeWindow + handler : ()=>{throw { HBErrorCode: '470', code: 470, message: 'Too many failed login attempts, try again later' }; } }); //Local version username and password diff --git a/themes/themes.json b/themes/themes.json index 0d28c7394..bc719185d 100644 --- a/themes/themes.json +++ b/themes/themes.json @@ -29,12 +29,12 @@ "baseSnippets": false, "path": "Blank" }, - "Journal": { + "journal": { "name": "Journal", "renderer": "V3", "baseTheme": false, "baseSnippets": "5ePHB", - "path": "Journal" + "path": "journal" } } } \ No newline at end of file