habitica/test
Fiz f26d2a59ae
add InvalidCredentialsError with language-agnostic code (#15472)
* add InvalidCredentialsError with language-agnostic code and update backend & web logout logic

* error.code in API error responses

Updated the error handler to serialize responseErr.code as the JSON error field, falling back to responseErr.name when no code is set.

* fix(lint): whitespace and missing def

* fix(lint): missed one

* add InvalidCredentialsError case for bad token

Add test verifying that auth middleware throws InvalidCredentialsError with code "invalid_credentials" and correct translated message when the API token is invalid.

* fix(test): user fields implicitly required

---------

Co-authored-by: Kalista Payne <sabrecat@gmail.com>
2025-07-15 09:49:11 -05:00
..
api add InvalidCredentialsError with language-agnostic code (#15472) 2025-07-15 09:49:11 -05:00
common Squashed commit of the following: 2024-11-14 12:31:57 -06:00
content chore: update grand gala start dates (#15435) 2025-06-19 18:05:38 -05:00
helpers refactor(client): move to Vite by @phillipthelen 2025-06-11 19:20:11 -05:00
migrations API v3 [WIP] (#6144) 2016-05-23 13:58:31 +02:00
sanity chore: update sub-deps and fix lint 2020-07-01 18:20:18 +02:00
.eslintrc.js Upgrade to mongoose 7 (#14971) 2024-01-16 15:18:47 -06:00
mocha.opts fix path (again) 2019-10-15 15:57:09 +02:00
README.md chore: replace http wiki links with https (#13528) 2021-10-01 17:58:09 -05:00

For information about writing and running tests, see Using Your Local Install to Modify Habitica's Website and API.