File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -8,21 +8,21 @@ import {
8
8
Config ,
9
9
globalSetup ,
10
10
} from "@playwright/test"
11
- import * as bcrypt from "bcrypt "
11
+ import * as argon2 from "argon2 "
12
12
import path from "path"
13
13
import { PASSWORD } from "./utils/constants"
14
14
import * as wtfnode from "./utils/wtfnode"
15
15
16
16
// Playwright doesn't like that ../src/node/util has an enum in it
17
17
// so I had to copy hash in separately
18
- const hash = ( str : string ) : string => {
19
- return bcrypt . hashSync ( str , 10 )
18
+ const hash = async ( str : string ) : Promise < string > => {
19
+ return await argon2 . hash ( str )
20
20
}
21
21
22
22
const cookieToStore = {
23
23
sameSite : "Lax" as const ,
24
24
name : "key" ,
25
- value : hash ( PASSWORD ) ,
25
+ value : "" ,
26
26
domain : "localhost" ,
27
27
path : "/" ,
28
28
expires : - 1 ,
@@ -38,6 +38,8 @@ globalSetup(async () => {
38
38
wtfnode . setup ( )
39
39
}
40
40
41
+ cookieToStore . value = await hash ( PASSWORD )
42
+
41
43
const storage = {
42
44
cookies : [ cookieToStore ] ,
43
45
}
You can’t perform that action at this time.
0 commit comments