Skip to content

Commit

Permalink
Fix set name as alias verification
Browse files Browse the repository at this point in the history
  • Loading branch information
sampaiodiego committed Jan 28, 2020
1 parent 9054f0d commit 6d63fad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/lib/server/functions/sendMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const validateUserIdentity = (message, _id) => {
}
const userIsNotABot = !user.roles.includes('bot');
const messageContainsAnyForbiddenProp = Object.keys(message).some((key) => forbiddenPropsToChangeWhenUserIsNotABot.includes(key));
if ((userIsNotABot && messageContainsAnyForbiddenProp) || (settings.get('Message_SetNameToAliasEnabled') && message.alias !== user.name)) {
if (userIsNotABot && messageContainsAnyForbiddenProp && message.alias !== user.name) {
throw new Error('You are not authorized to change message properties');
}
};
Expand Down

0 comments on commit 6d63fad

Please sign in to comment.