aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/router.js
diff options
context:
space:
mode:
Diffstat (limited to 'router.js')
-rw-r--r--router.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/router.js b/router.js
index ef95309..a7248d4 100644
--- a/router.js
+++ b/router.js
@@ -41,6 +41,25 @@ module.exports = function(app) {
});
+ /* POST */
+
+ app.post('/login', function(req, res) {
+ AM.manualLogin(req.param('user'), req.param('pass'), function(e, o) {
+ if (!o) {
+ res.send(e, 400);
+ } else {
+ req.session.user = o;
+ if (req.param('remember-me') == 'true') {
+ res.cookie('user', o.user, { maxAge: 900000 });
+ res.cookieI('pass', o.pass, { maxAge: 90000 });
+ }
+ res.send(o, 200);
+ }
+ });
+ });
+
+
+
/*
* GET signup page
*