ldap-authentication 3.3.3 → 3.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +8 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -98,6 +98,14 @@ async function _searchUser(
|
|
|
98
98
|
user = searchEntries[0]
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
// when attribute endwith ;binary, ldapts returns Buffer, we convert them into base64 string
|
|
102
|
+
if (user != null && attributes != null) {
|
|
103
|
+
for (let attr of attributes) {
|
|
104
|
+
if (attr.endsWith(';binary') && Buffer.isBuffer(user[attr])) {
|
|
105
|
+
user[attr] = user[attr].toString('base64')
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
101
109
|
return user
|
|
102
110
|
}
|
|
103
111
|
|