Morgbn / nuxt-csurf

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

No TS types respected of data #49

Closed JoniLieh closed 1 month ago

JoniLieh commented 2 months ago

When using useCsrfFetch, you cant specify the return data type:

const {
  data, 
  error, 
  status,
} = await useCsrfFetch<Log[]>('/api/admin/logs');

image

Expected: image

cd996 commented 1 month ago

UP. Just came to report this. since latest version

JoniLieh commented 1 month ago

For the record: Building your own useFetch function and implementing the csrf token in the header is the best solution

cd996 commented 1 month ago

For the record: Building your own useFetch function and implementing the csrf token in the header is the best solution

Hi,Could you please provide specific examples for reference?

WuChenDi commented 1 month ago

@Morgbn HI,

I apologize for the interruption.

I noticed that this issue has been marked as closed, yet it persists in the latest version I am using. Therefore, I would like to inquire whether it has not yet been addressed in the most recent release.

github-actions[bot] commented 2 weeks ago

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

The release is available on:

Your semantic-release bot :package::rocket: