Merge pull request #9315 from jfsiebel/enforce-extract-credentials

Enforce extractCredentials
This commit is contained in:
Tiago D J 2020-04-29 01:46:24 -03:00 committed by GitHub
commit 8f6e87b5ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 13 deletions

View File

@ -1,13 +1,16 @@
import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import RedisPubSub from '/imports/startup/server/redis';
import { extractCredentials } from '/imports/api/common/server/helpers';
export default function setPresenterInPodReqMsg(credentials) { // TODO-- switch to meetingId, etc
const REDIS_CONFIG = Meteor.settings.private.redis;
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
const EVENT_NAME = 'SetPresenterInPodReqMsg';
const { meetingId, requesterUserId, presenterId } = credentials;
const { presenterId } = credentials;
const { meetingId, requesterUserId } = extractCredentials(this.userId);
check(meetingId, String);
check(requesterUserId, String);

View File

@ -1,7 +1,9 @@
import UserInfos from '/imports/api/users-infos';
import Logger from '/imports/startup/server/logger';
import { extractCredentials } from '/imports/api/common/server/helpers';
export default function removeUserInformation(meetingId, requesterUserId) {
export default function removeUserInformation() {
const { meetingId, requesterUserId } = extractCredentials(this.userId);
const selector = {
meetingId,
requesterUserId,

View File

@ -1,6 +1,7 @@
import { check } from 'meteor/check';
import addUserSetting from '/imports/api/users-settings/server/modifiers/addUserSetting';
import logger from '/imports/startup/server/logger';
import { extractCredentials } from '/imports/api/common/server/helpers';
const oldParameters = {
askForFeedbackOnLogout: 'bbb_ask_for_feedback_on_logout',
@ -73,9 +74,11 @@ function valueParser(val) {
}
}
export default function addUserSettings(meetingId, userId, settings) {
export default function addUserSettings(settings) {
check(settings, [Object]);
const { meetingId, requesterUserId: userId } = extractCredentials(this.userId);
let parameters = {};
settings.forEach((el) => {

View File

@ -140,13 +140,11 @@ class JoinHandler extends Component {
};
const setCustomData = (resp) => {
const {
meetingID, internalUserID, customdata,
} = resp;
const { customdata } = resp;
return new Promise((resolve) => {
if (customdata.length) {
makeCall('addUserSettings', meetingID, internalUserID, customdata).then(r => resolve(r));
makeCall('addUserSettings', customdata).then(r => resolve(r));
}
resolve(true);
});

View File

@ -53,13 +53,11 @@ class UserInfoComponent extends Component {
}
render() {
const {
intl, meetingId, requesterUserId,
} = this.props;
const { intl } = this.props;
return (
<Modal
title={intl.formatMessage(intlMessages.title)}
onRequestClose={() => Service.handleCloseUserInfo(meetingId, requesterUserId)}
onRequestClose={() => Service.handleCloseUserInfo()}
>
{this.renderUserInfo()}
</Modal>

View File

@ -1,7 +1,7 @@
import { makeCall } from '/imports/ui/services/api';
export default {
handleCloseUserInfo: (meetingId, requesterUserId) => {
makeCall('removeUserInformation', meetingId, requesterUserId);
handleCloseUserInfo: () => {
makeCall('removeUserInformation');
},
};