I'm using laravel's defult auth system but I'm sending requests threw ajax. If I am for example on login page and I send some wrong data, it throws me an error into console:
POST http://some.app/auth/login/ 422 (Unprocessable Entity)
but actually it returns some data:
email: ["The email must be a valid email address."]
Same weird acting for registration.
1. how to fix those status codes?
2. how to handle those errors? Just writing data.email and data.password to an user? Isn't there a better solution?
3. what about csrf token? I'm sending it with data but it doesn't seem to require that
Thanks