Sidekiq's web interface logs out the user in Rails 5.2.3

Viewed 85

I've been trying to figure out this issue for quite some time, and finally narrowed it 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}"
0 Answers
Related