bigbluebutton-Github/bigbluebutton-html5/imports/api/users/server/methods/userLogout.js
2016-06-17 18:15:11 -04:00

19 lines
814 B
JavaScript
Executable File

import { isAllowedTo } from '/imports/startup/server/userPermissions';
import { requestUserLeaving } from '/imports/api/users/server/modifiers/requestUserLeaving';
import { logger } from '/imports/startup/server/logger';
Meteor.methods({
// meetingId: the meeting where the user is
// userId: the userid of the user logging out
// authToken: the authToken of the user
userLogout(credentials) {
if (isAllowedTo('logoutSelf', credentials)) {
const { meetingId, requesterUserId, requesterToken } = credentials;
// logger.info(`a user is logging out from ${meetingId}:${userId}`);
logger.info(`a user is logging out from ${meetingId}:${requesterUserId}`);
// return requestUserLeaving(meetingId, userId);
return requestUserLeaving(meetingId, requesterUserId);
}
},
});