Morgbn / nuxt-csurf

Nuxt Cross-Site Request Forgery (CSRF) Prevention
https://nuxt-csurf.vercel.app
MIT License
67 stars 15 forks source link

TS support #3

Closed rcerljenko closed 1 year ago

rcerljenko commented 1 year ago

Nuxt TSC complains when you try to overrride a return type of useCsrfFetch function like this:

const response = await useCsrfFetch<TurnstileValidationResponse>('/_turnstile/validate', {
    method: 'POST',
    body: {
        token
    }
})

Normal useFetch allows that, Could you probably type this function just like normal useFetch ?

Morgbn commented 1 year ago

Hi! Hope this commit will fix this bug

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 1.0.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

rcerljenko commented 1 year ago

thanks!