manchenkoff / nuxt-auth-sanctum

Nuxt module for Laravel Sanctum authentication
https://manchenkoff.gitbook.io/nuxt-auth-sanctum/
MIT License
116 stars 16 forks source link

Reduce CSRF calls and support refreshing on SSR side #91

Closed manchenkoff closed 1 month ago

manchenkoff commented 1 month ago

Is your PR related to a specific issue/feature? Please describe and mention issues.

Closes #88 with a change that checks current cookies and requests a new CSRF token only when it is not set. Also, in order to reduce calls to API, SSR cookies propagation was configured. As a result, when the module tries to initialize the user, the XSRF token cookie will be set on the client side as well.

Checklist: