Better login logging
This commit is contained in:
parent
9d71f91e13
commit
14f62ac072
3 changed files with 6 additions and 6 deletions
2
Makefile
2
Makefile
|
@ -28,7 +28,7 @@ migrate: ## Migrate database schema
|
||||||
init: ## Migrate database schema
|
init: ## Migrate database schema
|
||||||
docker-compose run --rm app yarn run init
|
docker-compose run --rm app yarn run init
|
||||||
|
|
||||||
.PHONY: watch
|
.PHONY: watch-frontend
|
||||||
watch-frontend: ## Build and watch for changes
|
watch-frontend: ## Build and watch for changes
|
||||||
docker-compose run --rm app yarn run watch
|
docker-compose run --rm app yarn run watch
|
||||||
|
|
||||||
|
|
|
@ -8,18 +8,18 @@
|
||||||
"node": "^11.6.0"
|
"node": "^11.6.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "npm run build-js && npm run build-sass",
|
"build": "yarn run build-js && yarn run build-sass",
|
||||||
"build-js": "webpack --progress -p -c webpack.config.js",
|
"build-js": "webpack --progress -p -c webpack.config.js",
|
||||||
"build-sass": "node-sass --include-path ./node_modules/ -r -o web/public/styles/ web/public/styles/",
|
"build-sass": "node-sass --include-path ./node_modules/ -r -o web/public/styles/ web/public/styles/",
|
||||||
"cover": "istanbul cover _mocha -- -r babel-register test/**/*.spec.js",
|
"cover": "istanbul cover _mocha -- -r babel-register test/**/*.spec.js",
|
||||||
"heroku-postbuild": "npm run build",
|
"heroku-postbuild": "yarn run build",
|
||||||
"init": "babel-node -e \"require('./lib/storage').default();\"",
|
"init": "babel-node -e \"require('./lib/storage').default();\"",
|
||||||
"initdb": "node -r babel-register test/initdb.js",
|
"initdb": "node -r babel-register test/initdb.js",
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
"start": "node -r babel-register app.js",
|
"start": "node -r babel-register app.js",
|
||||||
"test": "npm run test-seed && mocha -r babel-register test/**/*.spec.js",
|
"test": "yarn run test-seed && mocha -r babel-register test/**/*.spec.js",
|
||||||
"test-seed": "babel-node test/fixtures/user.js",
|
"test-seed": "babel-node test/fixtures/user.js",
|
||||||
"watch": "concurrently -k -n watch-js,watch-server \"npm run watch-js\" \"npm run watch-server\"",
|
"watch": "concurrently -k -n watch-js,watch-sass \"yarn run watch-js\" \"yarn run watch-sass\"",
|
||||||
"watch-js": "webpack --mode=development --progress -c webpack.config.js",
|
"watch-js": "webpack --mode=development --progress -c webpack.config.js",
|
||||||
"watch-server": "nodemon -r babel-register -i web/public",
|
"watch-server": "nodemon -r babel-register -i web/public",
|
||||||
"watch-sass": "node-sass --include-path ./node_modules/ -w -r -o web/public/styles/ web/public/styles/"
|
"watch-sass": "node-sass --include-path ./node_modules/ -w -r -o web/public/styles/ web/public/styles/"
|
||||||
|
|
|
@ -48,6 +48,7 @@ export async function authenticate(email, password) {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (user && user.password) {
|
if (user && user.password) {
|
||||||
|
login.userId = user.id;
|
||||||
if (await passwords.verify(password, user.password)) {
|
if (await passwords.verify(password, user.password)) {
|
||||||
debug('Password verified');
|
debug('Password verified');
|
||||||
login.successful = true;
|
login.successful = true;
|
||||||
|
@ -55,7 +56,6 @@ export async function authenticate(email, password) {
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
debug('Password invalid');
|
debug('Password invalid');
|
||||||
login.userId = user.id;
|
|
||||||
}
|
}
|
||||||
await login.save();
|
await login.save();
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue