File tree Expand file tree Collapse file tree 3 files changed +22
-194
lines changed Expand file tree Collapse file tree 3 files changed +22
-194
lines changed Original file line number Diff line number Diff line change 1
1
import crypto from 'crypto' ;
2
2
import { v4 , v5 , validate } from 'uuid' ;
3
- import bcrypt from 'bcrypt ' ;
3
+ import bcrypt from 'bcryptjs ' ;
4
4
import { JWT , JWE , JWK } from 'jose' ;
5
5
import { startOfMonth } from 'date-fns' ;
6
6
@@ -40,11 +40,11 @@ export function getRandomChars(n) {
40
40
}
41
41
42
42
export async function hashPassword ( password ) {
43
- return bcrypt . hash ( password , SALT_ROUNDS ) ;
43
+ return bcrypt . hashSync ( password , SALT_ROUNDS ) ;
44
44
}
45
45
46
46
export async function checkPassword ( password , hash ) {
47
- return bcrypt . compare ( password , hash ) ;
47
+ return bcrypt . compareSync ( password , hash ) ;
48
48
}
49
49
50
50
export async function createToken ( payload ) {
Original file line number Diff line number Diff line change 58
58
"dependencies" : {
59
59
"@prisma/client" : " 2.21.2" ,
60
60
"@reduxjs/toolkit" : " ^1.5.1" ,
61
- "bcrypt " : " ^5.0.1 " ,
61
+ "bcryptjs " : " ^2.4.3 " ,
62
62
"chalk" : " ^4.1.1" ,
63
63
"chart.js" : " ^2.9.4" ,
64
64
"classnames" : " ^2.3.1" ,
You can’t perform that action at this time.
0 commit comments