diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/index.js | 18 | ||||
-rw-r--r-- | src/routes/index.js | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/index.js b/src/index.js index 49f1349..6296534 100644 --- a/src/index.js +++ b/src/index.js | |||
@@ -17,15 +17,15 @@ app.use(express.json()); | |||
17 | app.use(express.urlencoded({ extended: true })); | 17 | app.use(express.urlencoded({ extended: true })); |
18 | app.use(express.static(path.join(__dirname, "public"))); | 18 | app.use(express.static(path.join(__dirname, "public"))); |
19 | app.use(cookieParser()); | 19 | app.use(cookieParser()); |
20 | // app.use( | 20 | app.use( |
21 | // rateLimit({ | 21 | rateLimit({ |
22 | // windowMs: 15 * 60 * 1000, | 22 | windowMs: 15 * 60 * 1000, |
23 | // max: 100, | 23 | max: 100, |
24 | // message: "Too many requests from this IP, please try again later.", | 24 | message: "Too many requests from this IP, please try again later.", |
25 | // standardHeaders: true, | 25 | standardHeaders: true, |
26 | // legacyHeaders: false, | 26 | legacyHeaders: false, |
27 | // }), | 27 | }), |
28 | // ); | 28 | ); |
29 | app.use("/", routes); | 29 | app.use("/", routes); |
30 | 30 | ||
31 | const port = process.env.READIT_PORT; | 31 | const port = process.env.READIT_PORT; |
diff --git a/src/routes/index.js b/src/routes/index.js index 4bc45cd..9a415be 100644 --- a/src/routes/index.js +++ b/src/routes/index.js | |||
@@ -126,7 +126,7 @@ router.get("/dashboard", authenticateToken, async (req, res) => { | |||
126 | 126 | ||
127 | router.get("/create-invite", authenticateAdmin, async (req, res) => { | 127 | router.get("/create-invite", authenticateAdmin, async (req, res) => { |
128 | function generateInviteToken() { | 128 | function generateInviteToken() { |
129 | const hasher = new Bun.CryptoHasher("sha256", "super-secret-invite-key"); | 129 | const hasher = new Bun.CryptoHasher("sha256"); |
130 | return hasher.update(Math.random().toString()).digest("hex").slice(0, 10); | 130 | return hasher.update(Math.random().toString()).digest("hex").slice(0, 10); |
131 | } | 131 | } |
132 | 132 | ||