I'm using Ruby On Rails 3.0.9 and everything works fine on Development env. When I switch to Production env, or I upload it to our server, after sign in I'm taken back to the same Login page. When I check the log, I can see the following:
Started POST "/users/login" for 127.0.0.1 at Thu Oct 03 16:48:13 -0300 2013
Processing by UserSessionsController#create as HTML
Parameters: {"user"=>{"password"=>"[FILTERED]", "login"=>"demo_admin"}, "utf8"=>"✓", "authenticity_token"=>"+7AEoVXZ9XiagEymVUnOhFHnck4rgDu883E/ySMlCxQ="}
Redirected to http://localhost:3000/admin
Completed 302 Found in 111ms
Started GET "/admin" for 127.0.0.1 at Thu Oct 03 16:48:13 -0300 2013
Processing by Admin::DashboardController#index as HTML
Completed 401 Unauthorized in 1ms
I'm using authorization_rules file in order to manage access, but I've got no problem on Dev env, as I said before.
If I place a breakpoint at the admin/dashboard#index
action, it won't be executed, as it's not reached. It breaks at httpserver file (I debugged it step by step), but I cannot understand why it works on Dev and not on Prod env.
Please, help.
Thanks, Brian
UPDATE
I forgor to mention that, in my ApplicationController
, there's a before_filter called check_plan_features
and the first thing it asks is unless current_user.blank? #redirects to Admin section
.
I've noticed that after signing in, using Devise, current_user
has the user's value, but when after redirecting to the admin section, it comes back to the same filter, and this time, the current_user
is null. So, I assume that, somehow, the user's session is destroyed after trying to access Admin section. But, as this only happens on production environment, I'm still wondering what could be.