Skip to content

Commit

Permalink
Update saml_utils.js
Browse files Browse the repository at this point in the history
Mongo DB don't support "." as key
Fix RocketChat#10931
  • Loading branch information
misi authored May 31, 2018
1 parent 80e55cf commit 681b456
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/meteor-accounts-saml/saml_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,12 @@ SAML.prototype.validateResponse = function(samlResponse, relayState, callback) {
if (attributes) {
attributes.forEach(function(attribute) {
const value = self.getElement(attribute, 'AttributeValue');
let key = attribute.$.Name.value;
key=key.replace(/\./g, '-');
if (typeof value[0] === 'string') {
profile[attribute.$.Name.value] = value[0];
profile[key] = value[0];
} else {
profile[attribute.$.Name.value] = value[0]._;
profile[key] = value[0]._;
}
});
}
Expand Down

0 comments on commit 681b456

Please sign in to comment.