I am trying to use Nuxt/auth, but run into problem with session saving in localStorage
.
Login.vue
methods: {
sendLoginLink() {
this.$auth.loginWith('local', {
data: {
username: "test@gmail.com",
password: "testpassword"
}
}).then((date) => {
console.log("data", date)
}).catch((err) => {
console.error("err", err)
})
}
Nuxt.config.js
auth: {
strategies: {
local: {
endpoints: {
login: { url: '/dashboard', method: 'post', propertyName: 'token' }
},
tokenType: ''
}
}
axios: {
baseURL: 'http://localhost:1234'
},
modules: [
'@nuxtjs/axios',
'@nuxtjs/auth-next',
]
When the user logs in, the function sendLoginLink is called and throw error in console:
Which means that the auth-token is so large that it cannot be stored in localStorage
, but all other things related to this function are saved in localStorage
. For example:
I googled a lot but didn't find a good solution to the problem. For example, I tried to clear all localStorage
memory before running sendLoginLink() function but the result is the same. Different browsers have the same problem