i am new in nuxt and can't solve the problem when i try to submit form for getting 422 error should not go anywhere and should show error on console but its redirecting in error page with content
'Request failed with status code 422
An error occurred while rendering the page. Check developer tools console for details.'
how to prevent this
my code very is simple login
export default {
data() {
return {
form: {
email: '',
password: ''
}
}
},
methods: {
async submit() {
await this.$auth.login({
data: this.form
})
}
}
}
This issue as been imported as question since it does not respect nuxt.js issue template. Only bug reports and feature requests stays open to reduce maintainers workload.
If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically.
Your question is available at https://cmty.app/nuxt/nuxt.js/issues/c8815.
i already posted to your website but no answer from your website
here is link
No solution to this problem.
Facing the same issue here :(
In my case i am using nuxt-auth
await this.$auth.loginWith("local",{
data: this.form
});
@haideritx i have the same issue but when i use axios it works :
await this.$axios.$post('login',{email:this.email,password:this.password})
Any updates on this issue?
yeah i catched the error like this
.catch(error => {
console.log(error.response.data)
})
its working like a charm
yeah i catched the error like this
.catch(error => { console.log(error.response.data) })its working like a charm
worked for me as well. Thank you.
its working like a charm. cheers
Most helpful comment
yeah i catched the error like this
its working like a charm