dystcz / nuxt-sanctum-auth

Nuxt 3 + laravel sanctum authentication
135 stars 25 forks source link

Added ability to add custom CSRF keys #13

Closed Conor-Hughes closed 1 year ago

Conor-Hughes commented 1 year ago

Hey, I've come across an issue with hosting two Laravel apps on two different subdomains which is setting the XSRF-TOKEN cookie over two different subdomains (described in more detail here).

As a result, I've taken the idea from the responses of the above thread to set a custom name for the CSRF token on one of the Laravel apps (XSRF-TOKEN-PORTAL) and set the header that the frontend sends to X-XSRF-TOKEN-PORTAL.

I've created a branch to allow the user to set a custom CSRF key for the header, and a custom cookie key value.

Hopefully this is useful!

kreejzak commented 1 year ago

Hi @Conor-Hughes, Thanks for the PR!

I will look into it in next few days.

Conor-Hughes commented 1 year ago

@kreejzak Thanks! Let me know if there's any issues

kreejzak commented 1 year ago

Sure, everything seems ok, I will update the readme and publish new version shortly. Thank you for your contribution 🙌

kreejzak commented 1 year ago

v0.4.2