Skip to content

Commit af00f8e

Browse files
committed
Validation for Request MLE for JWT
1 parent 2d5d46b commit af00f8e

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/authentication/core/MerchantConfig.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -673,26 +673,26 @@ MerchantConfig.prototype.defaultPropValues = function defaultPropValues() {
673673

674674
//useMLEGlobally check for auth Type
675675
if (this.enableRequestMLEForOptionalApisGlobally === true || this.mapToControlMLEonAPI != null) {
676-
// if (this.enableRequestMLEForOptionalApisGlobally === true && this.authenticationType.toLowerCase() !== Constants.JWT) {
677-
// ApiException.ApiException("MLE is only supported in JWT auth type", logger);
678-
// }
676+
if (this.enableRequestMLEForOptionalApisGlobally === true && this.authenticationType.toLowerCase() !== Constants.JWT) {
677+
ApiException.ApiException("Request MLE is only supported in JWT auth type", logger);
678+
}
679679

680680
if (this.mapToControlMLEonAPI != null && typeof (this.mapToControlMLEonAPI) !== "object") {
681681
ApiException.ApiException("mapToControlMLEonAPI in merchantConfig should be key value pair", logger);
682682
}
683683

684-
// if (this.mapToControlMLEonAPI != null && Object.keys(this.mapToControlMLEonAPI).length !== 0) {
685-
// var hasTrueValue = false;
686-
// for (const[key, value] of Object.entries(this.mapToControlMLEonAPI)) {
687-
// if (value === true) {
688-
// hasTrueValue = true;
689-
// break;
690-
// }
691-
// }
692-
// if (hasTrueValue && this.authenticationType.toLowerCase() !== Constants.JWT) {
693-
// ApiException.ApiException("MLE is only supported in JWT auth type", logger);
694-
// }
695-
// }
684+
if (this.mapToControlMLEonAPI != null && Object.keys(this.mapToControlMLEonAPI).length !== 0) {
685+
var hasTrueValue = false;
686+
for (const[key, value] of Object.entries(this.mapToControlMLEonAPI)) {
687+
if (value === true) {
688+
hasTrueValue = true;
689+
break;
690+
}
691+
}
692+
if (hasTrueValue && this.authenticationType.toLowerCase() !== Constants.JWT) {
693+
ApiException.ApiException("Request MLE is only supported in JWT auth type", logger);
694+
}
695+
}
696696
}
697697
if (this.mleForRequestPublicCertPath) {
698698
// First check if the file exists and is readable

0 commit comments

Comments
 (0)