I have a form which related on v-model
. So, it is default login page. When I try to log in I got unautorized 401, but in Postman I got the token with same credentials.
export default {
data() {
return {
email: '',
password: '',
output: ''
};
},
methods: {
login() {
axios.post('api/login', {
email: this.email,
password: this.password },
{ headers: {
'Content-type': 'application/x-www-form-urlencoded',
}
}).then(response => {
this.output = response.data;
});
}
}
}