From c06af31f26b06f808ca5844982942abba4a6be36 Mon Sep 17 00:00:00 2001 From: Akif9748 Date: Sat, 10 Sep 2022 21:02:24 +0300 Subject: [PATCH] Fix for req session --- APIDOCS.md | 4 ++-- routes/register.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/APIDOCS.md b/APIDOCS.md index 1dc48ef..de1f615 100644 --- a/APIDOCS.md +++ b/APIDOCS.md @@ -20,8 +20,8 @@ But in front end, the API will works with session. - GET `/api/bans/` fetch all bans. -- GET `/api/bans/:id` fetch a ban. -- DELETE `/api/bans/:id` for unban an IP adress. +- GET `/api/bans/:ip` fetch a ban. +- DELETE `/api/bans/:ip` for unban an IP adress. - POST `/api/bans?reason=flood` for ban an IP adress. diff --git a/routes/register.js b/routes/register.js index eb308bd..50d61ec 100644 --- a/routes/register.js +++ b/routes/register.js @@ -11,7 +11,8 @@ app.post("/", rateLimit({ windowMs: 24 * 60 * 60_000, max: 5, standardHeaders: true, legacyHeaders: false, handler: (_r, response, _n, options) => response.error(options.statusCode, "You are begin ratelimited") }), async (req, res) => { - req.session.destroy() + + req.session.userID=null; let { username = null, password: body_pass = null, avatar, about } = req.body;