This commit is contained in:
XD 2022-10-17 23:47:52 +08:00
parent 03c040a2cb
commit da163ca6f9
2 changed files with 3 additions and 0 deletions

View File

@ -39,6 +39,7 @@ export class UserService {
sn: "",
mail: "",
avatarurl: "",
userPassword: user.password,
});
entries.push(personEntry);

View File

@ -1,4 +1,5 @@
import {ldapConfig} from "../ldap.config";
import {createHash} from "crypto";
export function getRootDN() {
return ldapConfig.rootDN;
@ -64,6 +65,7 @@ export function makePersonEntry(dn, attrs) {
// };
// const generatedDN = makeOrganizationUnitEntryDN(dn);
const generatedDN = makeDN(dn, getRootDN());
attrs.userPassword = createHash('md5').update(attrs.userPassword).digest('hex');
return {
dn: generatedDN,
attributes: Object.assign({