@@ -9,9 +9,6 @@ require("dotenv-mono").load();
9
9
10
10
describe . runIf ( process . env . TW_SECRET_KEY ) (
11
11
"Wallet Authentication - EVM - Smart Wallet" ,
12
- {
13
- timeout : 240000 ,
14
- } ,
15
12
async ( ) => {
16
13
let adminWallet : any , signerWallet : any , attackerWallet : any ;
17
14
let auth : ThirdwebAuth ;
@@ -42,7 +39,9 @@ describe.runIf(process.env.TW_SECRET_KEY)(
42
39
auth . updateWallet ( signerWallet ) ;
43
40
} ) ;
44
41
45
- it ( "Should verify logged in wallet" , async ( ) => {
42
+ it ( "Should verify logged in wallet" , {
43
+ timeout : 240000 ,
44
+ } , async ( ) => {
46
45
const payload = await auth . login ( ) ;
47
46
48
47
auth . updateWallet ( adminWallet ) ;
@@ -51,7 +50,9 @@ describe.runIf(process.env.TW_SECRET_KEY)(
51
50
expect ( address ) . to . equal ( await signerWallet . getAddress ( ) ) ;
52
51
} ) ;
53
52
54
- it ( "Should verify logged in wallet with chain ID and expiration" , async ( ) => {
53
+ it ( "Should verify logged in wallet with chain ID and expiration" , {
54
+ timeout : 240000 ,
55
+ } , async ( ) => {
55
56
const payload = await auth . login ( {
56
57
expirationTime : new Date ( Date . now ( ) + 1000 * 60 * 5 ) ,
57
58
chainId : "84532" ,
@@ -65,7 +66,9 @@ describe.runIf(process.env.TW_SECRET_KEY)(
65
66
expect ( address ) . to . equal ( await signerWallet . getAddress ( ) ) ;
66
67
} ) ;
67
68
68
- it ( "Should verify payload with resources" , async ( ) => {
69
+ it ( "Should verify payload with resources" , {
70
+ timeout : 240000 ,
71
+ } , async ( ) => {
69
72
const payload = await auth . login ( {
70
73
resources : [ "https://example.com" , "https://test.com" ] ,
71
74
} ) ;
@@ -78,7 +81,9 @@ describe.runIf(process.env.TW_SECRET_KEY)(
78
81
expect ( address ) . to . equal ( await signerWallet . getAddress ( ) ) ;
79
82
} ) ;
80
83
81
- it ( "Should reject payload without necessary resources" , async ( ) => {
84
+ it ( "Should reject payload without necessary resources" , {
85
+ timeout : 240000 ,
86
+ } , async ( ) => {
82
87
const payload = await auth . login ( {
83
88
resources : [ "https://example.com" ] ,
84
89
} ) ;
@@ -96,7 +101,9 @@ describe.runIf(process.env.TW_SECRET_KEY)(
96
101
}
97
102
} ) ;
98
103
99
- it ( "Should verify payload with customized statement" , async ( ) => {
104
+ it ( "Should verify payload with customized statement" , {
105
+ timeout : 240000 ,
106
+ } , async ( ) => {
100
107
const payload = await auth . login ( {
101
108
statement : "Please sign!" ,
102
109
} ) ;
@@ -109,7 +116,9 @@ describe.runIf(process.env.TW_SECRET_KEY)(
109
116
expect ( address ) . to . equal ( await signerWallet . getAddress ( ) ) ;
110
117
} ) ;
111
118
112
- it ( "Should reject payload with incorrect statement" , async ( ) => {
119
+ it ( "Should reject payload with incorrect statement" , {
120
+ timeout : 240000 ,
121
+ } , async ( ) => {
113
122
const payload = await auth . login ( {
114
123
statement : "Please sign!" ,
115
124
} ) ;
@@ -127,7 +136,9 @@ describe.runIf(process.env.TW_SECRET_KEY)(
127
136
}
128
137
} ) ;
129
138
130
- it ( "Should reject invalid nonce" , async ( ) => {
139
+ it ( "Should reject invalid nonce" , {
140
+ timeout : 240000 ,
141
+ } , async ( ) => {
131
142
const payload = await auth . login ( ) ;
132
143
133
144
auth . updateWallet ( adminWallet ) ;
@@ -145,7 +156,9 @@ describe.runIf(process.env.TW_SECRET_KEY)(
145
156
}
146
157
} ) ;
147
158
148
- it ( "Should accept valid nonce" , async ( ) => {
159
+ it ( "Should accept valid nonce" , {
160
+ timeout : 240000 ,
161
+ } , async ( ) => {
149
162
const payload = await auth . login ( ) ;
150
163
151
164
auth . updateWallet ( adminWallet ) ;
@@ -160,7 +173,9 @@ describe.runIf(process.env.TW_SECRET_KEY)(
160
173
expect ( address ) . to . equal ( await signerWallet . getAddress ( ) ) ;
161
174
} ) ;
162
175
163
- it ( "Should reject payload with incorrect domain" , async ( ) => {
176
+ it ( "Should reject payload with incorrect domain" , {
177
+ timeout : 240000 ,
178
+ } , async ( ) => {
164
179
const payload = await auth . login ( ) ;
165
180
166
181
auth . updateWallet ( adminWallet ) ;
@@ -174,7 +189,9 @@ describe.runIf(process.env.TW_SECRET_KEY)(
174
189
}
175
190
} ) ;
176
191
177
- it ( "Should reject expired login payload" , async ( ) => {
192
+ it ( "Should reject expired login payload" , {
193
+ timeout : 240000 ,
194
+ } , async ( ) => {
178
195
const payload = await auth . login ( {
179
196
expirationTime : new Date ( Date . now ( ) - 1000 * 60 * 5 ) ,
180
197
} ) ;
@@ -188,7 +205,9 @@ describe.runIf(process.env.TW_SECRET_KEY)(
188
205
}
189
206
} ) ;
190
207
191
- it ( "Should reject payload with incorrect chain ID" , async ( ) => {
208
+ it ( "Should reject payload with incorrect chain ID" , {
209
+ timeout : 240000 ,
210
+ } , async ( ) => {
192
211
const payload = await auth . login ( {
193
212
chainId : "1" ,
194
213
} ) ;
@@ -206,7 +225,9 @@ describe.runIf(process.env.TW_SECRET_KEY)(
206
225
}
207
226
} ) ;
208
227
209
- it ( "Should reject payload with incorrect signer" , async ( ) => {
228
+ it ( "Should reject payload with incorrect signer" , {
229
+ timeout : 240000 ,
230
+ } , async ( ) => {
210
231
const payload = await auth . login ( ) ;
211
232
payload . payload . address = await attackerWallet . getAddress ( ) ;
212
233
@@ -219,7 +240,9 @@ describe.runIf(process.env.TW_SECRET_KEY)(
219
240
}
220
241
} ) ;
221
242
222
- it ( "Should generate valid authentication token" , async ( ) => {
243
+ it ( "Should generate valid authentication token" , {
244
+ timeout : 240000 ,
245
+ } , async ( ) => {
223
246
const payload = await auth . login ( ) ;
224
247
225
248
auth . updateWallet ( adminWallet ) ;
@@ -229,7 +252,9 @@ describe.runIf(process.env.TW_SECRET_KEY)(
229
252
expect ( user . address ) . to . equal ( await signerWallet . getAddress ( ) ) ;
230
253
} ) ;
231
254
232
- it ( "Should reject token with incorrect domain" , async ( ) => {
255
+ it ( "Should reject token with incorrect domain" , {
256
+ timeout : 240000 ,
257
+ } , async ( ) => {
233
258
const payload = await auth . login ( ) ;
234
259
235
260
auth . updateWallet ( adminWallet ) ;
@@ -245,7 +270,9 @@ describe.runIf(process.env.TW_SECRET_KEY)(
245
270
}
246
271
} ) ;
247
272
248
- it ( "Should reject token before invalid before" , async ( ) => {
273
+ it ( "Should reject token before invalid before" , {
274
+ timeout : 240000 ,
275
+ } , async ( ) => {
249
276
const payload = await auth . login ( ) ;
250
277
251
278
auth . updateWallet ( adminWallet ) ;
@@ -261,7 +288,9 @@ describe.runIf(process.env.TW_SECRET_KEY)(
261
288
}
262
289
} ) ;
263
290
264
- it ( "Should reject expired authentication token" , async ( ) => {
291
+ it ( "Should reject expired authentication token" , {
292
+ timeout : 240000 ,
293
+ } , async ( ) => {
265
294
const payload = await auth . login ( ) ;
266
295
267
296
auth . updateWallet ( adminWallet ) ;
@@ -277,7 +306,9 @@ describe.runIf(process.env.TW_SECRET_KEY)(
277
306
}
278
307
} ) ;
279
308
280
- it ( "Should reject if admin address is not connected wallet address" , async ( ) => {
309
+ it ( "Should reject if admin address is not connected wallet address" , {
310
+ timeout : 240000 ,
311
+ } , async ( ) => {
281
312
const payload = await auth . login ( ) ;
282
313
283
314
auth . updateWallet ( adminWallet ) ;
@@ -294,7 +325,9 @@ describe.runIf(process.env.TW_SECRET_KEY)(
294
325
}
295
326
} ) ;
296
327
297
- it ( "Should accept token with valid token ID" , async ( ) => {
328
+ it ( "Should accept token with valid token ID" , {
329
+ timeout : 240000 ,
330
+ } , async ( ) => {
298
331
const payload = await auth . login ( ) ;
299
332
300
333
auth . updateWallet ( adminWallet ) ;
@@ -313,7 +346,9 @@ describe.runIf(process.env.TW_SECRET_KEY)(
313
346
expect ( user . address ) . to . equal ( await signerWallet . getAddress ( ) ) ;
314
347
} ) ;
315
348
316
- it ( "Should reject token with invalid token ID" , async ( ) => {
349
+ it ( "Should reject token with invalid token ID" , {
350
+ timeout : 240000 ,
351
+ } , async ( ) => {
317
352
const payload = await auth . login ( ) ;
318
353
319
354
auth . updateWallet ( adminWallet ) ;
@@ -335,7 +370,9 @@ describe.runIf(process.env.TW_SECRET_KEY)(
335
370
}
336
371
} ) ;
337
372
338
- it ( "Should propagate session on token" , async ( ) => {
373
+ it ( "Should propagate session on token" , {
374
+ timeout : 240000 ,
375
+ } , async ( ) => {
339
376
const payload = await auth . login ( ) ;
340
377
341
378
auth . updateWallet ( adminWallet ) ;
@@ -349,7 +386,9 @@ describe.runIf(process.env.TW_SECRET_KEY)(
349
386
expect ( user . session ) . to . deep . equal ( { role : "admin" } ) ;
350
387
} ) ;
351
388
352
- it ( "Should call session callback function" , async ( ) => {
389
+ it ( "Should call session callback function" , {
390
+ timeout : 240000 ,
391
+ } , async ( ) => {
353
392
const payload = await auth . login ( ) ;
354
393
355
394
auth . updateWallet ( adminWallet ) ;
@@ -368,7 +407,9 @@ describe.runIf(process.env.TW_SECRET_KEY)(
368
407
} ) ;
369
408
} ) ;
370
409
371
- it ( "Should authenticate with issuer address" , async ( ) => {
410
+ it ( "Should authenticate with issuer address" , {
411
+ timeout : 240000 ,
412
+ } , async ( ) => {
372
413
const payload = await auth . login ( ) ;
373
414
374
415
auth . updateWallet ( adminWallet ) ;
0 commit comments