Skip to content
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

Response Status Codes #118

Open
swbloom opened this issue Jul 6, 2017 · 0 comments
Open

Response Status Codes #118

swbloom opened this issue Jul 6, 2017 · 0 comments

Comments

@swbloom
Copy link
Contributor

swbloom commented Jul 6, 2017

(apologies if this is incorrect)

The API sends a lot of 200 status codes for things that probably should have a more specific status code - for example, a failed authentication sends a 200 when (i think) it should send a 401.

I believe this is because res.send defaults a 200 if you don't explicitly send a status code, but again I could be misinterpreting this.

This will be helpful on the front end because it allows for a programmatic way to isolate behaviour based on status code responses, something like:

    if (error.status === 401) {
        logOutUser();
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant