This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
[Enhancement] Unify the JSON response bodies of the register, login and forgot password actions when performing AJAX requests #2495
Labels
enhancement
improvements to existing features
site development 👩💻
features related to website/API development
A colleague of mine was busy implementing validation on AJAX forms for the registration, login and forgot password forms when he noticed that the aforementioned all return a different JSON structure. The structures as they are right now are:
Register:
{"errors":{"username":["Username \"email@domain.com\" is already taken."],"email":["Email \"email@domain.com\" is already taken."]}}
Login:
{"errorCode":2,"error":"Invalid email address or password"}
Forgot password:
{"error":["Username or email address invalid."]}
It could be interesting to unify these response bodies into something more uniform that allows easier validation whenever these forms are approached via AJAX.
The text was updated successfully, but these errors were encountered: