File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { Logger } from '@nestjs/common';
1010import { Entry as LdapEntry , Client as LdapClient } from 'ldapts' ;
1111import { Users } from '../users.interface' ;
1212import { ConfigService } from '@nestjs/config' ;
13+ import { genSaltSync } from 'bcryptjs' ;
1314
1415type LDAPConfig = {
1516 url : string ;
@@ -91,7 +92,7 @@ export class LdapUsersService implements Users {
9192 firstName : ldapEntry [ this . ldapConfig . attributeFirstName ] . toString ( ) ,
9293 lastName : ldapEntry [ this . ldapConfig . attributeLastName ] . toString ( ) ,
9394 apiKey : this . authService . generateApiKey ( ) ,
94- password : await this . authService . encryptPassword ( Math . random ( ) . toString ( 36 ) . slice ( - 8 ) ) ,
95+ password : await this . authService . encryptPassword ( genSaltSync ( 1 ) . slice ( - 12 ) ) ,
9596 role : Role . editor ,
9697 } ;
9798
You can’t perform that action at this time.
0 commit comments