From a8ec5fe2637c499d578199b2c0b416fbb521b8c9 Mon Sep 17 00:00:00 2001 From: Nil Date: Sat, 20 Jul 2024 18:06:35 +0200 Subject: [PATCH 1/3] chore: Update server.js to serve static files and handle SPA routing with rate limiting --- frontend/server.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/frontend/server.js b/frontend/server.js index 45dcd8e..eff5d6e 100644 --- a/frontend/server.js +++ b/frontend/server.js @@ -1,14 +1,19 @@ const express = require("express"); const path = require("path"); -const app = express(); const PORT = process.env.PORT || 3000; +let RateLimit = require("express-rate-limit"); -app.use(express.static(path.join(__dirname, "dist"))); +const limiter = new RateLimit({ + windowMs: 1 * 60 * 1000, + max: 50, +}); + +express().use(express.static(path.join(__dirname, "dist")), limiter); -app.get("*", (req, res) => { +express().get("*", (req, res) => { res.sendFile(path.resolve(__dirname, "dist", "index.html")); }); -app.listen(PORT, () => { +express().listen(PORT, () => { console.log(`Server is running on http://localhost:${PORT}`); }); From 91b4f3fa759e8952e9ce5f5dbb6b00cf833ee2ff Mon Sep 17 00:00:00 2001 From: Nil Date: Sat, 20 Jul 2024 18:07:47 +0200 Subject: [PATCH 2/3] refactor: Update server.js to serve static files and handle SPA routing with rate limiting --- frontend/server.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend/server.js b/frontend/server.js index eff5d6e..35fb9ca 100644 --- a/frontend/server.js +++ b/frontend/server.js @@ -1,19 +1,23 @@ const express = require("express"); const path = require("path"); const PORT = process.env.PORT || 3000; -let RateLimit = require("express-rate-limit"); +const RateLimit = require("express-rate-limit"); + +const app = express(); const limiter = new RateLimit({ windowMs: 1 * 60 * 1000, max: 50, }); -express().use(express.static(path.join(__dirname, "dist")), limiter); +app.use(limiter); + +app.use(express.static(path.join(__dirname, "dist"))); -express().get("*", (req, res) => { +app.get("*", (req, res) => { res.sendFile(path.resolve(__dirname, "dist", "index.html")); }); -express().listen(PORT, () => { +app.listen(PORT, () => { console.log(`Server is running on http://localhost:${PORT}`); }); From 857e7191d6c2f6ce57571681d40f242a05521ec3 Mon Sep 17 00:00:00 2001 From: Nil Date: Tue, 23 Jul 2024 10:09:52 +0200 Subject: [PATCH 3/3] chore: Update password field label in HelloWorld.vue component --- frontend/src/components/HelloWorld.vue | 76 +++++++++++++++++++++++--- 1 file changed, 68 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/HelloWorld.vue b/frontend/src/components/HelloWorld.vue index ec42991..fe9990e 100644 --- a/frontend/src/components/HelloWorld.vue +++ b/frontend/src/components/HelloWorld.vue @@ -11,6 +11,16 @@ + + +
+

This tool is designed to enhance your security by checking if your password + has been exposed in any known breaches. By analyzing hashed versions of passwords against common + dictionaries and wordlists, it helps determine if your password is still secure.

+
+
+
+

Enter a password

@@ -62,29 +72,79 @@ async function hashPassword() { }); } - -