Files
planka/server/api/controllers/users/show.js

17 lines
377 B
JavaScript
Executable File

module.exports = {
async fn(inputs, exits) {
// TODO: allow over HTTP without subscription
if (!this.req.isSocket) {
return this.res.badRequest();
}
const { currentUser } = this.req;
sails.sockets.join(this.req, `user:${currentUser.id}`); // TODO: only when subscription needed
return exits.success({
item: currentUser,
});
},
};