-
Notifications
You must be signed in to change notification settings - Fork 927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs: Debugging SSR #1197
Comments
I have another debug step you could add to this list; I have lost a few hours because of it. For local development, it is common to have a configuration like this: axios: {
baseURL: 'http://localhost:8000'
} When using SSR nuxt.js is trying to reach the server via the ipv6 loopback interface |
Thanks, added :) |
TL;DR: If your authentication needs the It appears a number of people are using this auth package in combination with Laravel Sanctum. Because of this, I'll mention the following, as it took me several ours to debug on top of the listed debugging steps. It is related to debug tip #9. When using Laravel Sanctum (or another authentication protocol that relies on the To configure this: // nuxt.config.js
export default {
// ...
auth: {
// ...
strategies: {
laravelSanctum: {
// ...
provider: 'laravel/sanctum',
url: process.env.SANCTUM_URL,
endpoints: {
login: { url: '/auth/login', method: 'post' },
logout: { url: '/auth/logout', method: 'post' },
user: {
url: '/auth/user',
method: 'get',
withCredentials: true,
headers: {
referer: process.env.SANCTUM_REFERER,
origin: process.env.SANCTUM_REFERER, // <-- ensure this domain matches one of your SANCTUM_STATEFUL_DOMAINS from your Laravel .env.
},
},
},
},
},
// ...
},
} Why does this happen? Many systems are configured to remove the referer header from a request when the connection protocol is downgraded. When the load balancer performs SSL termination (thus taking an HTTPS connection and passing it on as HTTP to your api servers), the chain may remove the To remedy this with Sanctum, you can include the |
This is a collection of SSR debugging steps that I will passively collect - note that few of these are under the control of the auth module.
user.property
instead.For more ideas, check #258
The text was updated successfully, but these errors were encountered: