When the 'login' request is expecting a JSON response and there's an error it now receives a JSON error rather than being redirected to the registration handler.