Skip to content

With latest ldapts veresion we are checking isConnected wrong #81

@stalkerg

Description

@stalkerg

This trace:

TypeError: Cannot read properties of undefined (reading 'isConnected')
    at authenticateWithUser (/node_modules/ldap-authentication/index.js:242:24)

We do now:

try {
    ldapUserClient = await _ldapBind(userDn, userPassword, starttls, ldapOpts)
  } catch (error) {
    if (ldapUserClient.isConnected) {
      await ldapUserClient.unbind()
    }
    throw error
  }

But if we will catch an exception here, the ldapUserClient will be undefined.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions