metadata
This commit is contained in:
parent
f6486bd226
commit
fe66922627
|
@ -15,3 +15,7 @@ exports.getLast10Metadata = function () {
|
||||||
return db.any('select id, uuid, title, description, ts_created from metadata order by ts_created desc limit 10')
|
return db.any('select id, uuid, title, description, ts_created from metadata order by ts_created desc limit 10')
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.login = function(name, password) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
"start": "node ./bin/www"
|
"start": "node ./bin/www"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"bcrypt": "^1.0.3",
|
||||||
"bluebird": "^3.4.7",
|
"bluebird": "^3.4.7",
|
||||||
"body-parser": "~1.15.2",
|
"body-parser": "~1.15.2",
|
||||||
"bootstrap": "^3.3.7",
|
"bootstrap": "^3.3.7",
|
||||||
|
|
|
@ -10,4 +10,14 @@ router.get('/', function (req, res, next) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
router.post('/', function(req, res, next) {
|
||||||
|
if (req.body.username && req.body.username === 'user' && req.body.password && req.body.password === 'pass') {
|
||||||
|
req.session.authenticated = true;
|
||||||
|
res.redirect('/secure');
|
||||||
|
} else {
|
||||||
|
req.flash('error', 'Username and password are incorrect');
|
||||||
|
res.redirect('/login');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
module.exports = router;
|
module.exports = router;
|
||||||
|
|
Loading…
Reference in New Issue