1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-08-06 05:55:24 +02:00

Authentication (#22)

* Authorization added

* added secret to password, md5 hashing, removed promise from verifyToken, deleted links when not authorized

* added dbinsert script

* turned verifyToken to middleware, added description for dbinsert, added hidden csrf field in auth form

* added middlewares, user model and controller

* JSDoc fix

* wrong password processing fix

* added comments to dbinsert script, moved salt and passHash to singe db doc

* Moved salt to .env, upgradedscript for generating password was, fixed comments and JSDoc

* Deleted using salt (now user is only one), changed verifying password to bcrypt.compare, added httpyOnly property to jwt cookie
This commit is contained in:
Timur Kazantaev 2019-03-06 13:22:57 +03:00 committed by GitHub
parent 718be6d2f6
commit 58d3892d8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 1464 additions and 58 deletions

View file

@ -1,6 +1,7 @@
{
"name": "codex.docs",
"version": "0.0.0",
"bin": { "generatePassword": "bin/generatePassword.js"},
"private": true,
"scripts": {
"start": "cross-env NODE_ENV=production nodemon ./bin/www",
@ -8,20 +9,26 @@
"test": "cross-env NODE_ENV=testing mocha --recursive ./test",
"lint": "eslint --fix --cache ./src/**/*.js",
"build": "webpack ./src/frontend/js/app.js --o='./public/dist/[name].bundle.js' --output-library=Docs --output-public-path=/dist/ -p --watch",
"precommit": "yarn lint && yarn test --exit"
"precommit": "yarn lint && yarn test --exit",
"generatePassword": "node ./generatePassword.js"
},
"dependencies": {
"@babel/polyfill": "^7.0.0",
"bcrypt": "^3.0.3",
"body-parser": "latest",
"codex.editor": "^2.8.1",
"codex.editor.delimiter": "^1.0.2",
"codex.editor.embed": "^2.1.2",
"codex.editor.header": "^2.0.5",
"commander": "^2.19.0",
"codex.editor.image": "^2.0.3",
"codex.editor.quote": "^2.1.5",
"codex.editor.raw": "^2.0.2",
"cookie-parser": "~1.4.3",
"csurf": "^1.9.0",
"debug": "~4.1.0",
"dotenv": "^6.2.0",
"jsonwebtoken": "^8.4.0",
"eslint-plugin-standard": "^4.0.0",
"express": "~4.16.0",
"http-errors": "~1.7.1",