dystcz / nuxt-sanctum-auth

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

Changing cookie name #14

Closed TheSpecialist1 closed 1 year ago

TheSpecialist1 commented 1 year ago

is there any way to change the cookie name? by default it set to "nuxt-sanctum-auth-token".

kreejzak commented 1 year ago

Hi @TheSpecialist1 for now it's not possible to change the token cookie name. It should be easy to implement tho, gimme few days and I'll look into it.

TheSpecialist1 commented 1 year ago

Thank you.

On Sun, Apr 16, 2023 at 1:26 PM Paul Cross @.***> wrote:

Hi @TheSpecialist1 https://github.com/TheSpecialist1 for now it's not possible to change the token cookie name. It should be easy to implement tho, gimme few days and I'll look into it.

— Reply to this email directly, view it on GitHub https://github.com/dystcz/nuxt-sanctum-auth/issues/14#issuecomment-1510437498, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALCCPGRASWKSIMXI7YSFAJLXBQTUFANCNFSM6AAAAAAW73YTGE . You are receiving this because you were mentioned.Message ID: @.***>

kreejzak commented 1 year ago

-> v0.4.4 Just add this to your config and it should work.

export default defineNuxtConfig({
  // ...
  nuxtSanctumAuth: {
    csrf: {
      tokenCookieKey: 'nuxt-sanctum-auth-token'
    },
  }
})

Please close this issue if everything is ok. Thanks

TheSpecialist1 commented 1 year ago

Great! thanks. I'm going to use your package in production and will let you know if I find something else.

kreejzak commented 1 year ago

Awesome, closing this issue, if you find any other problems, please do create new separate issues. Thanks