Skip to content

Commit

Permalink
Merge branch '217-rocket-chat-requires-name-property' into 'develop'
Browse files Browse the repository at this point in the history
Resolve "Rocket Chat requires "name" property

Closes #217

See merge request hive/condenser!392
  • Loading branch information
Gandalf-the-Grey committed Sep 25, 2023
2 parents 12e0b96 + 39952df commit e3056f8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/server/rocket-chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,18 @@ export async function getChatAuthToken(username = '') {
};
}

// If user doesn't exist, let's create a user, when the settings
// allow to do this.
if (responseData1.error === 'User not found.') {
if (config.get('openhive_chat_iframe_create_users') === 'yes') {
// User doesn't exist, let's create user.
const url2 = `${rocketChatApiUri}/users.create`;
const data2 = {
name: '',
name: username,
username,
email: '',
password: secureRandom.randomBuffer(16).toString('hex'),
active: true,
joinDefaultChannels: true, // TODO Is this a good idea?
joinDefaultChannels: true,
sendWelcomeEmail: false
};
try {
Expand Down

0 comments on commit e3056f8

Please sign in to comment.