This is what is in my login page where I set the token and place it in a cookie, I am wanting to create a function to put on the logout button that removes this authtoken form the cookie
login: function () {
axios
.post(`${this.api}/op/auth/login`, this.loginCredentials, {
headers: { 'Content-type': 'application/json' },
})
.then((response) => {
this.setCookie(response.data)
console.log(JSON.stringify(response.data))
this.$setToken(response.data)
if (parseInt(this.$operator()) === 0) {
this.$router.push('/operators')
} else {
this.$router.push(`/operators/${this.$operator()}`)
}
})
.catch((error) => {
alert(JSON.stringify(error))
if (error.response) {
this.showError('Account Not Authorised')
console.log(error.response.data)
console.log(error.response.status)
console.log(error.response.headers)
} else if (error.request) {
console.log(error.request)
} else {
console.log('Error', error.message)
}
})
},