On 02/28/2012 06:08 PM, Matt Wagner wrote:
Hi,
If you become logged-out while using Conductor and your next request is done over AJAX,
the require_user method fails to find a template it can render and will display an error.
This adds a handler for the :js format, which will emit a 401 Unauthorized header. That,
as I learned, will automatically (through Warden?) get you
UserSessionsController#unauthenticated, which will display a warning message.
I started to try to customize this because I didn't love the wording that was shown,
"Login failed: The Username and Password you entered do not match", which is a
fairly odd thing to see if you're browsing along. However, the code is generic enough
that we don't know that you *became* logged out, just that you are unauthenticated. We
might want to make the message more generic, but I'm not keen on doing that as we have
strings already translated.
-- Matt
ACK works as intended. As you mentioned the error is a bit confusing now
but its better to have one in the format of a user-friendly string we
provide than a rails exception and we can fix this going forward.
-Mo