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.
Files changed (2) hide show
  1. package/index.js +8 -0
  2. 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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ldap-authentication",
3
- "version": "3.3.3",
3
+ "version": "3.3.4",
4
4
  "description": "A simple async nodejs library for LDAP user authentication",
5
5
  "main": "index.js",
6
6
  "types": "./index.d.ts",