Skip to content

Commit c0026cf

Browse files
jsumnersUzlopak
andauthored
Fix next branch tests (#157)
* Disable tsd * patch accordingly --------- Co-authored-by: Aras Abbasi <aras.abbasi@googlemail.com>
1 parent 7f88865 commit c0026cf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

types/index.test-d.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ fastify.register(FastifyCsrfProtection, {
4646
hmacKey: '123'
4747
},
4848
getUserInfo(req) {
49-
return req.session.get<'username', string>('username')
49+
const info = req.session.get('username')
50+
if (info) {
51+
return info
52+
} else {
53+
throw new Error('No user info')
54+
}
5055
}
5156
})
5257
expectError(fastify.register(FastifyCsrfProtection, { getUserInfo: 'invalid' }))

0 commit comments

Comments
 (0)