Skip to content

Commit

Permalink
fix: pass session to admin_constraint check on sidekiq route
Browse files Browse the repository at this point in the history
  • Loading branch information
orlando committed Sep 29, 2020
1 parent bf7aab1 commit beb7918
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/admin_constraint.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# frozen_string_literal: true

require_dependency 'current_user'
require_dependency "current_user"

class AdminConstraint
def initialize(options = {})
@require_master = options[:require_master]
end

def matches?(request)
current_user = SessionProvider.new(request.cookies).current_user
current_user = SessionProvider.new(request.cookies, request.session).current_user

current_user&.admin?
rescue StandardError
rescue
false
end
end

0 comments on commit beb7918

Please sign in to comment.