Production build breaks ldapjs' client.search()
Unanswered
Cuvier’s Dwarf Caiman posted this in #help-forum
Cuvier’s Dwarf CaimanOP
I'm using NextJS 14 and Next-Auth. I'm using the Credentials Provider which in turn uses ldapjs to auth and then pass creds to the JWT.
I do an initial client.bind() (using service account creds) which then allows me to do a client.search() for my actual login user. Once I have the DN of the login user via search I then do another client.bind() to authenticate as the login user.
This all works great in dev mode "npm run dev", but when I do a production build and 'npm start', the client.search() no longer returns any results; it just hangs. The 'searchEntry' event never activates.
For extra context, client.search() in ldapjs is implemented as a nodejs event emitter.
https://ldapjs.org/client.html
I used this as my starting point and added in a client.search():
https://next-auth.js.org/tutorials/ldap-auth-example
Help, please =/
I do an initial client.bind() (using service account creds) which then allows me to do a client.search() for my actual login user. Once I have the DN of the login user via search I then do another client.bind() to authenticate as the login user.
This all works great in dev mode "npm run dev", but when I do a production build and 'npm start', the client.search() no longer returns any results; it just hangs. The 'searchEntry' event never activates.
For extra context, client.search() in ldapjs is implemented as a nodejs event emitter.
https://ldapjs.org/client.html
I used this as my starting point and added in a client.search():
https://next-auth.js.org/tutorials/ldap-auth-example
Help, please =/