If return 401 (Unauthorized), I don’t know password field is wrong or username is wrong in frontend
.
Which code should return for password wrong? and which code for username wrong?
I wanna know exactly which field is wrong in authentication.
If return 401 (Unauthorized), I don’t know password field is wrong or username is wrong in frontend
.
Which code should return for password wrong? and which code for username wrong?
I wanna know exactly which field is wrong in authentication.
2
Answers
Usually to identify what happened in backend we send a HTTP code along with some kind of data/message in the body.
You can simply print parameters value which you send to the Api for better understanding which you send and which response you get. And please make a validation in Email and Password TextFormField because when email and password pattern perfect that after you can send a post request to the backend so you get less error.
Code for parameter printing: