You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One is caused by new Matcher and the other by applyContext, because this.principal[principalType] is undefined.
I'd like to suggest the following amendment:
private matchPrincipals(
principal: string,
principalType?: string,
context?: T
): boolean {
if (this.principal) {
if (this.principal instanceof Array) {
return principalType
? false
: this.principal.some((a) =>
new Matcher(applyContext(a, context)).match(principal)
);
} else {
+ const principalValues = this.principal[principalType];+ if (principalValues) {- if (principalType) {- const principalValues = this.principal[principalType];
if (principalValues instanceof Array) {
return principalValues.some((a) =>
new Matcher(applyContext(a, context)).match(principal)
);
}
return new Matcher(applyContext(principalValues, context)).match(
principal
);
}
return false;
}
}
return true;
}
The text was updated successfully, but these errors were encountered:
I tried setting the following:
I get a different error depending on whether I add a context or not:
Cannot read property 'trim' of undefined
Cannot read property 'replace' of undefined
In both cases the error occurs because of the following line:
One is caused by
new Matcher
and the other byapplyContext
, becausethis.principal[principalType]
isundefined
.I'd like to suggest the following amendment:
The text was updated successfully, but these errors were encountered: