Reevaluate API return codes during authentication #65

Open
opened 2026-04-05 23:52:26 +00:00 by luca0N · 0 comments
Owner

As it currently stands, the server will use the LANBASSADOR_RESPONSE_CODE_ERROR_NO_SUCH_OBJECT return code when a user attempts to login with invalid credentials. As such, the sendApiResponse function maps that value to the HTTP status code 404 Not Found, which may not be appropriate in the context of a REST-like API. 404'ing is appropriate when attempting to GET a non-existent object (e.g., GET /users/luca0n), but not on a static endpoint with no variables (as is the case with this endpoint).

If the return code is to be changed, then it must be done before the first stable version v1.0.0 to avoid the introduction of breaking changes in the future.

As it currently stands, the server will use the `LANBASSADOR_RESPONSE_CODE_ERROR_NO_SUCH_OBJECT` return code when a user attempts to login with invalid credentials. As such, the `sendApiResponse` function maps that value to the HTTP status code 404 Not Found, which may not be appropriate in the context of a REST-like API. 404'ing is appropriate when attempting to GET a non-existent object (e.g., `GET /users/luca0n`), but not on a static endpoint with no variables (as is the case with this endpoint). If the return code is to be changed, then it must be done before the first stable version v1.0.0 to avoid the introduction of breaking changes in the future.
luca0N added this to the v1.0.0 project 2026-04-05 23:52:26 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
luca0N/lanbassador#65
No description provided.