briggySmalls / detectordag

Power outage detector made with ♥ by a dag
MIT License
0 stars 0 forks source link

Distinguish between server and client errors #101

Open briggySmalls opened 3 years ago

briggySmalls commented 3 years ago

Currently the auth.middleware checks for the account ID and for permissions for accessing the endpoint.

But any errors are interpreted as an InternalServerError, including if the client's token doesn't give them permission to access the account they are requesting, which should be some sort of BadRequest.

briggySmalls commented 3 years ago

https://lockmedown.com/when-should-you-return-404-instead-of-403-http-status-code/