mirror of
https://github.com/wekan/wekan.git
synced 2025-04-24 05:57:13 -04:00
Added an endpoint to get the user referenced by the given token
This commit is contained in:
parent
609a8894ec
commit
fa928956c2
1 changed files with 10 additions and 0 deletions
|
@ -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, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue