diff options
author | Lauri Ojansivu <x@xet7.org> | 2017-05-18 10:31:47 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2017-05-18 10:31:47 +0300 |
commit | 8de6461cf7d944bdc056aabd28f28df4f7df28b0 (patch) | |
tree | 1c32fb32517d1394c155d98bf184b0dbb5e5c5c0 /models/users.js | |
parent | fe94ab0dde213d40d5e6f11e086678c4425ba377 (diff) | |
parent | e3fab5380690b955db7408f32b98b97f46497034 (diff) | |
download | wekan-8de6461cf7d944bdc056aabd28f28df4f7df28b0.tar.gz wekan-8de6461cf7d944bdc056aabd28f28df4f7df28b0.tar.bz2 wekan-8de6461cf7d944bdc056aabd28f28df4f7df28b0.zip |
Merge branch 'rest-api-pr' of https://github.com/mayjs/wekan into mayjs-rest-api-pr
Diffstat (limited to 'models/users.js')
-rw-r--r-- | models/users.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/models/users.js b/models/users.js index aa870dca..29504aa8 100644 --- a/models/users.js +++ b/models/users.js @@ -527,6 +527,16 @@ if (Meteor.isServer) { // USERS REST API if (Meteor.isServer) { + JsonRoutes.add('GET', '/api/user', function(req, res, next) { + Authentication.checkLoggedIn(req.userId); + const data = Meteor.users.findOne({ _id: req.userId}); + delete data.services; + JsonRoutes.sendResult(res, { + code: 200, + data, + }); + }); + JsonRoutes.add('GET', '/api/users', function (req, res, next) { Authentication.checkUserId( req.userId); JsonRoutes.sendResult(res, { |