Skip to content
Discussion options

You must be logged in to vote

Hey @projct1, this is the right way of doing this, module will use baseUrl as a prefix for all requests including sanctum token fetching (make sure to change the route on Laravel's side to support prefix).

Here is the example:

export default defineNuxtConfig({
  modules: [
    // other modules
    'nuxt-auth-sanctum'
  ],

  sanctum: {
    baseUrl: 'http://localhost:80/api/v1',
  }
})

Then, to load identity the module will call http://localhost:80/api/v1/api/user (if default config is used) and http://localhost:80/api/v1/sanctum/csrf-token to fetch a cookie content.

Please make sure you are using proper configuration and you have no overrides via environment variables.

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@projct1
Comment options

@manchenkoff
Comment options

Answer selected by manchenkoff
Comment options

You must be logged in to vote
3 replies
@manchenkoff
Comment options

@projct1
Comment options

@manchenkoff
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants