File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,18 +36,16 @@ declare namespace fastifyCsrfProtection {
3636 getToken ?: GetTokenFn ;
3737 }
3838
39+ type RequiredCSRFHmac = Omit < CSRFOptions , 'hmacKey' | 'userInfo' > &
40+ Required < Pick < CSRFOptions , 'hmacKey' > > & { userInfo : true }
41+
42+ type OptionalCSRFNoUserInfo = Omit < CSRFOptions , 'userInfo' > & {
43+ userInfo ?: false ;
44+ }
45+
3946 interface FastifyCsrfProtectionOptionsFastifyCookie {
4047 sessionPlugin ?: '@fastify/cookie' ;
41- csrfOpts ?: | ( {
42- [ k in keyof CSRFOptions ] : k extends 'userInfo'
43- ? true
44- : CSRFOptions [ k ] ;
45- } & Required < Pick < CSRFOptions , 'hmacKey' > > )
46- | ( {
47- [ k in keyof CSRFOptions ] : k extends 'userInfo'
48- ? false
49- : CSRFOptions [ k ] ;
50- } ) ;
48+ csrfOpts ?: OptionalCSRFNoUserInfo | RequiredCSRFHmac ;
5149 }
5250
5351 interface FastifyCsrfProtectionOptionsFastifySession {
You can’t perform that action at this time.
0 commit comments