Skip to content

fix: log and propagate getUserSettings middleware failures#11086

Open
Dev10-sys wants to merge 1 commit into
medic:masterfrom
Dev10-sys:fix/log-user-settings-auth-errors
Open

fix: log and propagate getUserSettings middleware failures#11086
Dev10-sys wants to merge 1 commit into
medic:masterfrom
Dev10-sys:fix/log-user-settings-auth-errors

Conversation

@Dev10-sys
Copy link
Copy Markdown

Fixes #11051

Previously, if auth.getUserSettings() failed, the error was caught and ignored without any log output. The request continued normally, making the failure difficult to detect and debug in production.

Changes

  • added proper error logging for failed getUserSettings calls
  • stored the error in req.authErr to match existing auth middleware behavior
  • preserved current middleware flow so requests do not hang
  • kept the fix minimal and scoped only to this issue

Tests

Added regression tests to verify:

  • errors are logged correctly
  • req.authErr is set properly
  • middleware continues safely after failures
  • online user middleware paths still work correctly

All related authorization middleware tests are passing.

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

Successfully merging this pull request may close these issues.

authorization.js middleware silently swallows getUserSettings errors

1 participant