Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Aug 2, 2018

Conversation

Hudell
Copy link
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
@@ -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];
Copy link
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

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

@Hudell
Copy link
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