I am overriding Devise\'s failure response so that I can set a 401 status code. However, when the user fails to sign in, they are redirected to a page with a \"you are being
Proper HTTP statuses for a redirection are in the 30x form (301 and 302 being the most frequently used). By default, the redirect_to helper sets a 302 status header on the HTTP response. If you override that and set that to a 401, your web browser will assume that the response is a regular web page and will render the response body --which, in a redirection, is the boilerplate text "You are being redirected".