Skip to content

Commit d18709e

Browse files
committed
Argon2 0.31 -> 0.43
1 parent 0ffddb8 commit d18709e

File tree

3 files changed

+34
-183
lines changed

3 files changed

+34
-183
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"@seedcompany/nest": "^1.4.0",
5555
"@seedcompany/nestjs-email": "^4.1.1",
5656
"@seedcompany/scripture": ">=0.8.0",
57-
"argon2": "^0.31.1",
57+
"argon2": "^0.43.0",
5858
"aws-xray-sdk-core": "^3.5.3",
5959
"chalk": "^5.3.0",
6060
"class-transformer": "^0.5.1",
Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { Injectable } from '@nestjs/common';
22
import * as argon2 from 'argon2';
3-
import { pickBy } from 'lodash';
4-
import { Except } from 'type-fest';
53
import { ConfigService } from '~/core';
64

75
@Injectable()
@@ -17,12 +15,10 @@ export class CryptoService {
1715
}
1816

1917
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;
2723
}
2824
}

0 commit comments

Comments
 (0)