Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Unify the JSON response bodies of the register, login and forgot password actions when performing AJAX requests #2495

Closed
wblommaert opened this issue Feb 26, 2018 · 1 comment
Labels
enhancement improvements to existing features site development 👩‍💻 features related to website/API development

Comments

@wblommaert
Copy link

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.

@wblommaert wblommaert changed the title [Enhancement] Unify the JSON response bodies of the register, login and forgot password when performing AJAX requests [Enhancement] Unify the JSON response bodies of the register, login and forgot password actions when performing AJAX requests Feb 26, 2018
@brandonkelly
Copy link
Member

We should especially consider this when building out a REST API (#815).

@brandonkelly brandonkelly added enhancement improvements to existing features site development 👩‍💻 features related to website/API development labels Feb 26, 2018
@craftcms craftcms locked and limited conversation to collaborators Jun 22, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
enhancement improvements to existing features site development 👩‍💻 features related to website/API development
Projects
None yet
Development

No branches or pull requests

2 participants