Apartment current_tenant resets to 'public' after failed devise login
问题 I use Devise for authentication and Apartment for multi-tenancy support on a SAAS app. After a failed login, devise "redirects" to the login page (Users::SessionsController#new) and the value of Apartment::Tenant.current which was previously set in a TenantElevator middleware goes back to its default value of "public". This is happening because Devise isn't actally redirecting to the login page but calling the FailureApp (which renders the login page) with a new rack env and returning its