1
0
mirror of https://github.com/bitwarden/directory-connector synced 2025-12-05 23:53:21 +00:00

current user bind

This commit is contained in:
Kyle Spearrin
2018-05-01 14:03:34 -04:00
parent 125de3e35e
commit e74b99ec65

View File

@@ -323,14 +323,13 @@ export class LdapDirectoryService implements DirectoryService {
url: url.toLowerCase(),
});
const user = this.dirConfig.username == null || this.dirConfig.username.trim() === '' ? null :
this.dirConfig.username;
const pass = this.dirConfig.password == null || this.dirConfig.password.trim() === '' ? null :
this.dirConfig.password;
if (user == null && pass == null) {
resolve();
return;
let user: string = null;
let pass: string = null;
if (!this.dirConfig.currentUser) {
user = this.dirConfig.username == null || this.dirConfig.username.trim() === '' ? null :
this.dirConfig.username;
pass = this.dirConfig.password == null || this.dirConfig.password.trim() === '' ? null :
this.dirConfig.password;
}
this.client.bind(user, pass, (err) => {