habitica/website/server
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
..
controllers reset the ApiToken on password changes/resets (#15433) 2025-07-01 12:30:34 -05:00
libs add InvalidCredentialsError with language-agnostic code (#15472) 2025-07-15 09:49:11 -05:00
middlewares add InvalidCredentialsError with language-agnostic code (#15472) 2025-07-15 09:49:11 -05:00
models Refactor Cron to be more robust (#15399) 2025-04-03 12:16:36 -05:00
.eslintrc.js Upgrade to mongoose 7 (#14971) 2024-01-16 15:18:47 -06:00
api-doc.js Adminpanel and revamped permissions (#13843) 2022-05-03 14:40:56 -05:00
index.js refactor(client): move to Vite by @phillipthelen 2025-06-11 19:20:11 -05:00
server.js Refactor Cron to be more robust (#15399) 2025-04-03 12:16:36 -05:00