Skip to content

Commit

Permalink
Fix scope issues in PR node-saml#131.
Browse files Browse the repository at this point in the history
  • Loading branch information
ploer committed Dec 30, 2015
1 parent 891aafb commit 094c660
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/passport-saml/saml.js
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,7 @@ SAML.prototype.processValidlySignedAssertion = function(xml, inResponseTo, callb
}

var subject = assertion.Subject;
var subjectConfirmation, confirmData;
if (subject) {
var nameID = subject[0].NameID;
if (nameID) {
Expand All @@ -685,10 +686,10 @@ SAML.prototype.processValidlySignedAssertion = function(xml, inResponseTo, callb
}
}

var subjectConfirmation = subject[0].SubjectConfirmation ?
subject[0].SubjectConfirmation[0] : null;
var confirmData = subjectConfirmation && subjectConfirmation.SubjectConfirmationData ?
subjectConfirmation.SubjectConfirmationData[0] : null;
subjectConfirmation = subject[0].SubjectConfirmation ?
subject[0].SubjectConfirmation[0] : null;
confirmData = subjectConfirmation && subjectConfirmation.SubjectConfirmationData ?
subjectConfirmation.SubjectConfirmationData[0] : null;
if (subject[0].SubjectConfirmation && subject[0].SubjectConfirmation.length > 1) {
msg = 'Unable to process multiple SubjectConfirmations in SAML assertion';
throw new Error(msg);
Expand Down

0 comments on commit 094c660

Please sign in to comment.