Skip to content

[FIX] SAML login not working when user has multiple emails#11642

Merged
sampaiodiego merged 2 commits intodevelopfrom
fix.saml-login-multiple-emails
Aug 2, 2018
Merged

[FIX] SAML login not working when user has multiple emails#11642
sampaiodiego merged 2 commits intodevelopfrom
fix.saml-login-multiple-emails

Conversation

@Hudell
Copy link
Copy Markdown
Contributor

@Hudell Hudell commented Aug 1, 2018

Closes #11603

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-11642 August 1, 2018 19:26 Inactive
@Hudell Hudell requested a review from rodrigok August 1, 2018 19:26
@Hudell Hudell added this to the 0.68.3 milestone Aug 1, 2018
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];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this cases I usually do something like: const emailList = [].concat(loginResult.profile.email);

@sampaiodiego sampaiodiego merged commit c023f32 into develop Aug 2, 2018
@sampaiodiego sampaiodiego deleted the fix.saml-login-multiple-emails branch August 2, 2018 00:53
@sampaiodiego sampaiodiego mentioned this pull request Aug 2, 2018
@ChessSpider
Copy link
Copy Markdown

👍 nice and quick
I do wonder how it works with user-matching though? Bcause that happens on email address too right?

@Hudell
Copy link
Copy Markdown
Contributor Author

Hudell commented Aug 2, 2018

It'll search for each email separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ya Login crash SAML 0.68.0

5 participants