I'm trying to implement my own authentification system
For the front im using Nuxtjs, and the back Nestjs,
When im logging in, i receive my auth JWT, while i dont refresh the page or change current page there is no problem, but when i'm leaving current page and i request my backend there is no more Authorization headers with received JWT
that's my @nuxt/auth config:
auth: {
strategies: {
local: {
token: {
property: 'access_token',
},
user: {
property: 'user',
},
endpoints: {
login: { url: '/api/auth/login', method: 'post' },
logout: false,
user: { url: '/api/auth/user', method: 'get' },
},
},
},
},
and my login function
async userLogin() {
try {
let response = await this.$auth.loginWith('local', { data: this.login })
console.log(this.$auth.user)
} catch (err) {}
},
can someone help me ?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…