diff --git a/Nodejs/initial.sql b/Nodejs/initial.sql index f0217c7..0f1b906 100644 --- a/Nodejs/initial.sql +++ b/Nodejs/initial.sql @@ -41,6 +41,14 @@ CREATE TABLE "t_users" ( "role" text ); + +CREATE TABLE "t_profile_posts" ( + "username" text, + "date_created" text, + "profile_post_content" text, + "post_id" bigint +); + CREATE TABLE "session" ( "sid" varchar NOT NULL COLLATE "default", "sess" json NOT NULL, diff --git a/Nodejs/odal.js b/Nodejs/odal.js index 7dfb9d4..dc6220e 100644 --- a/Nodejs/odal.js +++ b/Nodejs/odal.js @@ -56,7 +56,7 @@ app.use(session({ resave: false, saveUninitialized: false, cookie: {maxAge: null, secure: false, httpOnly: false}, - // In production change httpOnly to true and change 'secure' to true. + // In production change 'secure' to true. autoRemove: 'native', })); @@ -65,7 +65,7 @@ app.use(bodyParser.urlencoded({ extended: true })); const limiter = rateLimit({ windowMs: 15 * 60 * 1000, - max: 100 + max: 1000 }); app.use(limiter); @@ -115,7 +115,7 @@ app.post('/login', async function(req, res){ var userExists = await db.checkExistingUser(req.body.Username); if (req.body.Username == "" || req.body.Password == "") { throw '