We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8bb41f3 commit 984aec5Copy full SHA for 984aec5
1 file changed
lib/saml20.ts
@@ -107,15 +107,20 @@ const parse = (assertion) => {
107
const validateAudience = (assertion, realm) => {
108
const audience = getProp(assertion, 'Conditions.AudienceRestriction.Audience');
109
if (audience) {
110
- if (Array.isArray(realm)) {
111
- for (let i = 0; i < realm.length; i++) {
112
- if (audience.startsWith(realm[i])) {
113
- return true;
+ try {
+ if (Array.isArray(realm)) {
+ for (let i = 0; i < realm.length; i++) {
+ if (audience.startsWith(realm[i])) {
114
+ return true;
115
+ }
116
}
117
+ return false;
118
119
+ return audience.startsWith(realm);
120
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
121
+ } catch (err) {
122
return false;
123
- return audience.startsWith(realm);
124
} else {
125
126
0 commit comments