From b1d1305b47ac2d65d1f348a7c28104d54e42a461 Mon Sep 17 00:00:00 2001 From: "Pierre H. Lehnen" Date: Wed, 1 Aug 2018 21:53:23 -0300 Subject: [PATCH 1/6] [FIX] SAML login not working when user has multiple emails (#11642) --- packages/meteor-accounts-saml/saml_server.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/meteor-accounts-saml/saml_server.js b/packages/meteor-accounts-saml/saml_server.js index 9ffc945bff326..8e6dd13fdf957 100644 --- a/packages/meteor-accounts-saml/saml_server.js +++ b/packages/meteor-accounts-saml/saml_server.js @@ -103,8 +103,8 @@ Accounts.registerLoginHandler(function(loginRequest) { } if (loginResult && loginResult.profile && loginResult.profile.email) { - const email = RegExp.escape(loginResult.profile.email); - const emailRegex = new RegExp(`^${ email }$`, 'i'); + const emailList = Array.isArray(loginResult.profile.email) ? loginResult.profile.email : [loginResult.profile.email]; + const emailRegex = new RegExp(emailList.map(email => `^${ RegExp.escape(email) }$`).join('|'), 'i'); let user = Meteor.users.findOne({ 'emails.address': emailRegex }); @@ -114,10 +114,12 @@ Accounts.registerLoginHandler(function(loginRequest) { name: loginResult.profile.cn || loginResult.profile.username, active: true, globalRoles: ['user'], - emails: [{ - address: loginResult.profile.email, - verified: true - }] + emails: emailList.map(email => { + return { + address: email, + verified: true + }; + }) }; if (Accounts.saml.settings.generateUsername === true) { From 4b27388500dddfcb0cfd6bd38c0805c0b2b900bb Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Wed, 1 Aug 2018 17:19:18 -0300 Subject: [PATCH 2/6] [FIX] Prune translation on room info panel (#11635) --- .../client/views/channelSettings.html | 8 ++--- packages/rocketchat-i18n/i18n/en.i18n.json | 1 - packages/rocketchat-i18n/i18n/pt-BR.i18n.json | 30 +++++++++---------- packages/rocketchat-i18n/i18n/pt.i18n.json | 20 ++++++------- 4 files changed, 28 insertions(+), 31 deletions(-) diff --git a/packages/rocketchat-channel-settings/client/views/channelSettings.html b/packages/rocketchat-channel-settings/client/views/channelSettings.html index 0dc561874950f..c8d13749a8382 100644 --- a/packages/rocketchat-channel-settings/client/views/channelSettings.html +++ b/packages/rocketchat-channel-settings/client/views/channelSettings.html @@ -362,15 +362,15 @@