File tree Expand file tree Collapse file tree 3 files changed +34
-183
lines changed
src/components/authentication Expand file tree Collapse file tree 3 files changed +34
-183
lines changed Original file line number Diff line number Diff line change 54
54
"@seedcompany/nest" : " ^1.4.0" ,
55
55
"@seedcompany/nestjs-email" : " ^4.1.1" ,
56
56
"@seedcompany/scripture" : " >=0.8.0" ,
57
- "argon2" : " ^0.31.1 " ,
57
+ "argon2" : " ^0.43.0 " ,
58
58
"aws-xray-sdk-core" : " ^3.5.3" ,
59
59
"chalk" : " ^5.3.0" ,
60
60
"class-transformer" : " ^0.5.1" ,
Original file line number Diff line number Diff line change 1
1
import { Injectable } from '@nestjs/common' ;
2
2
import * as argon2 from 'argon2' ;
3
- import { pickBy } from 'lodash' ;
4
- import { Except } from 'type-fest' ;
5
3
import { ConfigService } from '~/core' ;
6
4
7
5
@Injectable ( )
@@ -17,12 +15,10 @@ export class CryptoService {
17
15
}
18
16
19
17
private get argon2Options ( ) {
20
- const options : Except < argon2 . Options , 'raw' > = {
21
- secret : this . config . passwordSecret
22
- ? Buffer . from ( this . config . passwordSecret , 'utf-8' )
23
- : undefined ,
24
- } ;
25
- // argon doesn't like undefined values even though the types allow them
26
- return pickBy ( options , ( v ) => v !== undefined ) ;
18
+ return {
19
+ ...( this . config . passwordSecret && {
20
+ secret : Buffer . from ( this . config . passwordSecret , 'utf-8' ) ,
21
+ } ) ,
22
+ } satisfies argon2 . Options ;
27
23
}
28
24
}
You can’t perform that action at this time.
0 commit comments