更新 'src/ldap/ldap.service.ts'
This commit is contained in:
parent
c225a4014c
commit
19c617368a
|
@ -119,19 +119,19 @@ export class LdapService {
|
|||
const cn = reqDN['rdns'][0].attrs.cn.value;
|
||||
const matchedUser = await this.userService.findOne(cn)
|
||||
console.log(matchedUser)
|
||||
// if (matchedUser) {
|
||||
// const record = await getDBRecordForUserId(matchedUser.attributes.uid);
|
||||
// if (record && validateUserPassword(record.password, req.credentials)) {
|
||||
// res.end();
|
||||
// return next();
|
||||
// } else {
|
||||
// console.debug('password failed');
|
||||
// return next(new ldap.InvalidCredentialsError());
|
||||
// }
|
||||
// } else {
|
||||
// console.debug('user not found');
|
||||
// return next(new ldap.InvalidCredentialsError());
|
||||
// }
|
||||
if (matchedUser) {
|
||||
const record = await getDBRecordForUserId(matchedUser.attributes.uid);
|
||||
if (record && validateUserPassword(record.password, req.credentials)) {
|
||||
res.end();
|
||||
return next();
|
||||
} else {
|
||||
console.debug('password failed');
|
||||
return next(new ldap.InvalidCredentialsError());
|
||||
}
|
||||
} else {
|
||||
console.debug('user not found');
|
||||
return next(new ldap.InvalidCredentialsError());
|
||||
}
|
||||
}
|
||||
|
||||
return next(new InsufficientAccessRightsError());
|
||||
|
|
Loading…
Reference in New Issue