volto
volto copied to clipboard
Fix login failure handling during hydration
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.