From f6f741dfac75d5632f1b461eab5782fa232b7b1c Mon Sep 17 00:00:00 2001 From: Jumpybuns Date: Thu, 14 Jan 2021 13:27:28 -0800 Subject: [PATCH 1/2] add SALT ROUND=4 --- .env copy | 1 + 1 file changed, 1 insertion(+) create mode 100644 .env copy diff --git a/.env copy b/.env copy new file mode 100644 index 0000000..5f05b75 --- /dev/null +++ b/.env copy @@ -0,0 +1 @@ +DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres From a2ed39ec0754268cc5e81c513f394193e664651a Mon Sep 17 00:00:00 2001 From: Jumpybuns Date: Thu, 14 Jan 2021 18:09:01 -0800 Subject: [PATCH 2/2] readme, heroku added, netlify made --- README.md | 15 ++++++++++++++- lib/controllers/auth.js | 18 +++++++++--------- package.json | 5 ++++- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 108e470..4e8c738 100644 --- a/README.md +++ b/README.md @@ -1 +1,14 @@ -# chatable-server \ No newline at end of file +# chatable-server +Ethan Pierce +Justin Martin +David Butler + +We are making basic live chat app that is able to connect people as well as branch off into different chat rooms. +We are using Github issues for our Kanban and it has many built features we are using for our PR and merge requests including PR approval, who the issue is assigned to, CI restrictions, and ticketing. + + +Heroku name: +quiet-thicket-46242 + +Netlify Site: +https://silly-booth-cbd86f.netlify.app \ No newline at end of file diff --git a/lib/controllers/auth.js b/lib/controllers/auth.js index a79401e..6a3edf8 100644 --- a/lib/controllers/auth.js +++ b/lib/controllers/auth.js @@ -4,20 +4,20 @@ const UserService = require('../services/UserService'); const attachCookie = (res, user) => { res.cookie('session', UserService.authToken(user), { - httpOnly: true, - maxAge: 1000 * 60 * 60 * 24, - sameSite: 'none', - secure: process.env.NODE_ENV === 'production' + httpOnly: true, + maxAge: 1000 * 60 * 60 * 24, + sameSite: 'none', + secure: process.env.NODE_ENV === 'production' }); -} +}; module.exports = Router() .post('/signup', (req, res, next) => { - UserService + UserService .create(req.body) .then(user => { attachCookie(res, user); - res.send(user) + res.send(user); }) .catch(next); }) @@ -27,12 +27,12 @@ module.exports = Router() .authorize(req.body) .then(user => { attachCookie(res, user); - res.send(user) + res.send(user); }) .catch(next); }) .get('/verify', ensureAuth, (req, res) => { - res.send(req.user) + res.send(req.user); }); diff --git a/package.json b/package.json index 1349102..28dd2df 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,10 @@ "test": "jest --verbose --runInBand --testLocationInResults --setupFiles dotenv/config", "test:watch": "npm run test -- --watch", "start": "node -r dotenv/config server.js", - "start:watch": "nodemon -r dotenv/config server.js" + "start:watch": "nodemon -r dotenv/config server.js", + "setup-db": "npm run recreate-tables && npm run load-seed-data", + "setup-db:prod": "heroku run npm run setup-db", + "setup-heroku": "heroku addons:create heroku-postgresql:hobby-dev && heroku config:set PGSSLMODE=require && heroku config:get DATABASE_URL" }, "jest": { "testEnvironment": "node"