From f54fbf1692e84db18a85c25dcc053f6a31c19e38 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Tue, 18 Apr 2023 14:43:17 +0300 Subject: [PATCH] Client: SSOStore: fix --- packages/client/src/store/SsoFormStore.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/client/src/store/SsoFormStore.js b/packages/client/src/store/SsoFormStore.js index d6abf65978..7f2283a487 100644 --- a/packages/client/src/store/SsoFormStore.js +++ b/packages/client/src/store/SsoFormStore.js @@ -484,7 +484,7 @@ class SsoFormStore { } }; - getPropValue(obj, propName) { + getPropValue = (obj, propName) => { let value = ""; if (!obj) return value; @@ -517,17 +517,15 @@ class SsoFormStore { } return value; - } + }; - includePropertyValue(obj, value) { + includePropertyValue = (obj, value) => { let props = Object.getOwnPropertyNames(obj); - for (let i = 0; i < props.length; i++) { if (obj[props[i]] === value) return true; } - return false; - } + }; setFieldsFromMetaData = async (meta) => { if (meta.entityID) { @@ -564,14 +562,14 @@ class SsoFormStore { if (meta.nameIDFormat) { if (Array.isArray(meta.nameIDFormat)) { - let formats = meta.nameIDFormat.filter(function (format) { + let formats = meta.nameIDFormat.filter((format) => { return this.includePropertyValue(SSO_NAME_ID_FORMAT, format); }); if (formats.length) { this.nameIdFormat = formats[0]; } } else { - if (includePropertyValue(SSO_NAME_ID_FORMAT, meta.nameIDFormat)) { + if (this.includePropertyValue(SSO_NAME_ID_FORMAT, meta.nameIDFormat)) { this.nameIdFormat = meta.nameIDFormat; } }