volto icon indicating copy to clipboard operation
volto copied to clipboard

Fix login failure handling during hydration

Open aryan7081 opened this issue 1 month ago • 0 comments

Fixes #7397 Backport Ref #7625 When login fails with a 401 Unauthorised error, the loader keeps spinning. This is because the hydration guard in middleware/api.js short-circuited every action (including LOGIN_FAIL) while isHydrating was true, so the error handler returned early before dispatching LOGIN_FAIL.

This patch limits the hydration guard to GET_CONTENT only, so user-initiated actions like LOGIN always dispatch their _FAIL actions and stop the loader. It also adds LOGIN to settings.actions_raising_api_errors, ensuring the global API error handler surfaces 401s properly.

aryan7081 avatar Nov 21 '25 14:11 aryan7081