更新 'src/ldap/ldap.service.ts'

This commit is contained in:
xd 2023-06-15 23:12:39 +08:00
parent c225a4014c
commit 19c617368a
1 changed files with 13 additions and 13 deletions

View File

@ -119,19 +119,19 @@ export class LdapService {
const cn = reqDN['rdns'][0].attrs.cn.value; const cn = reqDN['rdns'][0].attrs.cn.value;
const matchedUser = await this.userService.findOne(cn) const matchedUser = await this.userService.findOne(cn)
console.log(matchedUser) console.log(matchedUser)
// if (matchedUser) { if (matchedUser) {
// const record = await getDBRecordForUserId(matchedUser.attributes.uid); const record = await getDBRecordForUserId(matchedUser.attributes.uid);
// if (record && validateUserPassword(record.password, req.credentials)) { if (record && validateUserPassword(record.password, req.credentials)) {
// res.end(); res.end();
// return next(); return next();
// } else { } else {
// console.debug('password failed'); console.debug('password failed');
// return next(new ldap.InvalidCredentialsError()); return next(new ldap.InvalidCredentialsError());
// } }
// } else { } else {
// console.debug('user not found'); console.debug('user not found');
// return next(new ldap.InvalidCredentialsError()); return next(new ldap.InvalidCredentialsError());
// } }
} }
return next(new InsufficientAccessRightsError()); return next(new InsufficientAccessRightsError());