summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authormayjs <johannes.may@udo.edu>2017-05-15 18:44:54 +0200
committermayjs <johannes.may@udo.edu>2017-05-15 18:44:54 +0200
commitfa928956c2e9bfd21b18f973eded49775ce33e86 (patch)
tree773ad5944b886636c2d18ee387e37e241e26d3d0 /models
parent609a8894ece85ab36dc5ef88db5f290484dce9ff (diff)
downloadwekan-fa928956c2e9bfd21b18f973eded49775ce33e86.tar.gz
wekan-fa928956c2e9bfd21b18f973eded49775ce33e86.tar.bz2
wekan-fa928956c2e9bfd21b18f973eded49775ce33e86.zip
Added an endpoint to get the user referenced by the given token
Diffstat (limited to 'models')
-rw-r--r--models/users.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/models/users.js b/models/users.js
index aa870dca..55d0095e 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);
+ let 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, {