Removed OAuth leftover: emit event when calling /users/me (#9061)

refs #8342

- was added in this commit 319a388277
- we can remove this event
This commit is contained in:
Katharina Irrgang 2017-09-27 05:07:39 +02:00 committed by Hannah Wolfe
parent 3002747b68
commit baf8116d6b

View File

@ -7,7 +7,6 @@ var Promise = require('bluebird'),
canThis = require('../permissions').canThis,
models = require('../models'),
errors = require('../errors'),
events = require('../events'),
i18n = require('../i18n'),
docName = 'users',
// TODO: implement created_by, updated_by
@ -60,11 +59,10 @@ users = {
*/
read: function read(options) {
var attrs = ['id', 'slug', 'status', 'email', 'role'],
tasks,
isMe = options.id === 'me';
tasks;
// Special handling for /users/me request
if (isMe && options.context && options.context.user) {
if (options.id === 'me' && options.context && options.context.user) {
options.id = options.context.user;
}
@ -89,10 +87,6 @@ users = {
// Pipeline calls each task passing the result of one to be the arguments for the next
return pipeline(tasks, options).then(function formatResponse(result) {
if (result) {
if (isMe) {
events.emit('read:users:me', result);
}
return {users: [result.toJSON(options)]};
}