auth
auth copied to clipboard
Reading body of undefined
Environment
- Operating System:
Darwin - Node Version:
v21.5.0 - Nuxt Version:
3.9.3 - CLI Version:
3.10.0 - Nitro Version:
2.8.1 - Package Manager:
[email protected] - Builder:
- - User Config:
ssr,runtimeConfig,modules,imports,experimental,app,pwa,sourcemap,devtools,router,css,postcss,vite,nitro,typescript,http,auth,colorMode,plausible - Runtime Modules:
@nuxt/[email protected],@kevinmarrec/[email protected],normalizedModule(),@nuxt-alt/[email protected],@nuxt-alt/[email protected],@nuxtjs/[email protected],@nuxtjs/[email protected],@vueuse/[email protected],[email protected],v-wave/nuxt - Build Modules:
-
Nuxt Config
auth: {
globalMiddleware: true,
redirectStrategy: 'query', // Important! Otherwise, there will be an infinite logout loop.
stores: {
cookie: {
options: {
secure: import.meta.env.NODE_ENV === 'production', // Enable in production only.
sameSite: 'lax', // IMPORTANT!
},
},
},
redirect: {
login: '/login',
logout: '/login',
callback: '/login',
home: '/write',
},
strategies: {
local: {
scheme: 'refresh',
token: {
property: 'access',
type: 'JWT',
},
refreshToken: {
property: 'refresh',
data: 'refresh', // This is not a JWT token!
},
user: {
property: false,
},
endpoints: {
login: {
url: `${import.meta.env.API_URL}/auth/token/`,
method: 'post',
},
refresh: {
url: `${import.meta.env.API_URL}/auth/token/refresh/`,
method: 'post',
},
user: false,
logout: {
url: `${import.meta.env.API_URL}/user/logout/`,
method: 'post',
},
},
},
facebook: {
clientId: import.meta.env.FACEBOOK_CLIENT_ID,
responseType: 'code',
endpoints: {
token: `${import.meta.env.BACKEND_URL}/auth/social/facebook/`,
userInfo: `${import.meta.env.API_URL}/user/`,
},
token: {
// By default the token type is Bearer, but simple_jwt is configured
// to accept only JWT tokens.
type: 'JWT',
},
},
google: {
clientId: import.meta.env.GOOGLE_CLIENT_ID,
scope: [
'profile',
'email',
],
responseType: 'code',
codeChallengeMethod: '', // This is important!
endpoints: {
token: `${import.meta.env.BACKEND_URL}/auth/social/google/`,
userInfo: `${import.meta.env.API_URL}/user/`,
},
token: {
// The token type needs to match the AUTH_HEADER_TYPES setting under
// SIMPLE_JWT in the Django settings (Bearer by default).
type: 'JWT',
property: 'access',
},
refreshToken: {
// The refresh token is not a JWT token!
property: 'refresh',
},
},
},
},
Reproduction
Can't reproduce.
Describe the bug
I'm getting a lot of these errors, should there be a check if endpoint is undefined?
Additional context
No response
Logs
No response
use the beta tag
What do you mean with that?
use @nuxt-alt/auth@beta
Oh, thanks! Will try that 🙏🏽