Devise throws 401 unauthorized and redirects to Production / Staging only

I have an authentication system configured with Devise.

I can successfully enter development mode, but I cannot log in with valid credentials in staging / production environment.

Could it be the reason for storing the session?

This is what I have inside config / initializers / session_store.rb:

# Be sure to restart your server when you modify this file.

Rails.application.config.session_store :cookie_store, key: '_pigo_session'

      

I also added config.http_authenticatable = false

to config / intitializers / devise.rb

My staging.log file looks like this:

  I, [2015-06-10T16:57:20.325304 #3577]  INFO -- : Started GET "/" for 69.59.28.19 at 2015-06-10 16:57:20 +0400
  I, [2015-06-10T16:57:20.327106 #3577]  INFO -- : Processing by OffersController#index as HTML
  I, [2015-06-10T16:57:20.328034 #3577]  INFO -- : Filter chain halted as #<Proc:0x007fad7d18c5b8@/home/deploy/apps/pigo/shared/bundle/ruby/2.1.0/gems/actionpack-4.1.4/lib/action_controller/metal/http_authentication.rb:71> rendered or redirected
  I, [2015-06-10T16:57:20.328232 #3577]  INFO -- : Completed 401 Unauthorized in 1ms (ActiveRecord: 0.0ms)

      

+3


source to share





All Articles