Closed AlexanderObolonkov closed 1 year ago
I'm having the same problem
Version module: 5.0.0-1667386184.dfbbb54 nuxt: 2.15.8
Nuxt Configuration
modules: ['@nuxtjs/axios', '@nuxtjs/auth-next']
auth: {
strategies: {
local: {
token: {
property: 'records.token',
global: true,
},
user: {
property: 'records.user',
},
endpoints: {
login: { url: 'v1/auth/login', method: 'POST' },
logout: false,
user: { url: 'v1/users/profile', method: 'GET' },
},
},
},
},
My Request
async handleLogin() {
if (this.$refs.loginFormRef) {
if ((this.$refs.loginFormRef as HTMLFormElement).validate()) {
try {
this.$nuxt.$loading.start();
await this.$auth.loginWith('local', { data: this.loginForm });
} finally {
this.$nuxt.$loading.finish();
}
}
}
}
Debug Property 'Authorization' is not accessible in headers
Found my problem. In package.json I had installed axios and @nuxtjs/axios
Found my problem. In package.json I had installed axios and @nuxtjs/axios
Yep, it works. I didn't know about this conflict between axios`s. Thank you!
Version
module: 5.0.0 nuxt: 2.15.9
Nuxt configuration
Have a problem. It's been working fine, until today. I understand that it can't define $auth global variable, but how can i fix it?
My request
It doesn't even send request, because $auth is undefined, and it goes through catch.
Everything set to default.