Ivan Socolsky
9 years ago
No known key found for this signature in database
GPG Key ID: FAECE6A05FAA4F56
1 changed files with
18 additions and
0 deletions
-
lib/expressapp.js
|
|
@ -564,6 +564,24 @@ ExpressApp.prototype.start = function(opts, cb) { |
|
|
|
res.end(); |
|
|
|
}); |
|
|
|
|
|
|
|
router.post('/v1/login/', function(req, res) { |
|
|
|
getServerWithAuth(req, res, function(server) { |
|
|
|
server.login({}, function(err, session) { |
|
|
|
if (err) return returnError(err, res, req); |
|
|
|
res.json(session); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
router.post('/v1/logout/', function(req, res) { |
|
|
|
getServerWithAuth(req, res, function(server) { |
|
|
|
server.logout({}, function(err) { |
|
|
|
if (err) return returnError(err, res, req); |
|
|
|
res.end(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
router.get('/v1/notifications/', function(req, res) { |
|
|
|
getServerWithAuth(req, res, { |
|
|
|
allowSession: true, |
|
|
|