Browse Source

express endpoint

activeAddress
Ivan Socolsky 9 years ago
parent
commit
fed2338b0d
No known key found for this signature in database GPG Key ID: FAECE6A05FAA4F56
  1. 18
      lib/expressapp.js

18
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,

Loading…
Cancel
Save