2

I finally narrowed this issue down to the Sidekiq web interface. Whenever I'm using my app, everything works perfectly fine -- I can open new tabs and everything without an interrupted session.

However, the minute I browse to my app's sidekiq interface, it logs me out of my authenticated session.

Here's what I have in my config/routes file:

  require "sidekiq/pro/web"
  devise_scope :user do
    root to: "devise/sessions#new"

    authenticated :user do
      mount Sidekiq::Web => "/sidekiq", constraints: lambda { |request| request.remote_ip == "MY_IP_ADDERSS" }
    end
  end

This answer was suggested by Rails - devise and sidekiq routes. However, I have tried implementing that, as shown above, and it still doesn't seem to be working. What am I doing wrong in this scenario?

Here's my config/initializers/session_store.rb if this helps:

Rails.application.config.session_store :active_record_store, key: "session_key_#{Rails.env}"
halfer
  • 19,824
  • 17
  • 99
  • 186
LewlSauce
  • 5,326
  • 8
  • 44
  • 91

1 Answers1

0

this post helped me with the same problem. Looks like Sidekiq UI does not like the overwrites that activerecord-session_store promotes on the application. Here you can find a longer discussion about this topic with some suggestions to work around this problem.

Allam Matsubara
  • 517
  • 5
  • 18