我将 nuxt auth 与 laravel sanctum 一起使用,登录有效,但不再发送获取经过身份验证的用户的请求! 登录成功证明
这是我的 nuxt.config.js
axios: {
baseUrl: process.env.API_URL,
credentials: true,
},
auth: {
strategies: {
'laravelSanctum': {
provider: 'laravel/sanctum',
url: process.env.API_URL,
endpoints: {
login: { url: '/api/login'},
user: { url: '/api/user', method: 'get', propertyName: false },
},
autoFetchUser:true,
tokenRequired: true,
tokenType: "Bearer"
},
},
redirect: {
login: '/auth/login',
logout: '/auth/login',
callback: '/auth/login',
home: '/'
},
localStorage: false
},