Skip to content

Commit

Permalink
authenticated sidekiq web
Browse files Browse the repository at this point in the history
  • Loading branch information
michelson committed Aug 14, 2023
1 parent 8c0b1f9 commit 599d48b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require_relative "../lib/constraints/username_route_contrainer.rb"
require 'sidekiq/web'

Rails.application.routes.draw do
# devise_for :users
Expand Down Expand Up @@ -106,6 +107,10 @@
end
end

authenticate :user, lambda { |u| u.is_admin? } do
mount Sidekiq::Web => '/sidekiq'
end

constraints(Constraints::UsernameRouteConstrainer.new) do
# Same route as before, only within the constraints block
resources :users, path: "" do
Expand Down

0 comments on commit 599d48b

Please sign in to comment.