DEV Community

Vickyvn
Vickyvn

Posted on

Laravel sanctum and nuxt configuration

Laravel:

    1) .env => SESSION_DRIVER=cookie
               SANCTUM_STATEFUL_DOMAINS=nuxt.product.test
               SESSION_DOMAIN=.product.test:3000
Enter fullscreen mode Exit fullscreen mode

product.test is your laravel url.
nuxt.product.test is your subdomail for nuxt.

Nuxt:

    1)nuxt.config.js => 
        ssr: false,
        server: {
           host: 'http://nuxt.product.test',
           port: 3000,
        },
       modules: [
          '@nuxtjs/axios',
          '@nuxtjs/auth-next'
      ],
      axios: {
         credentials: true,
      },

Enter fullscreen mode Exit fullscreen mode

Discussion (0)