Skip to content

Instantly share code, notes, and snippets.

@matiaskorhonen
Created July 6, 2010 14:05
Show Gist options
  • Save matiaskorhonen/465413 to your computer and use it in GitHub Desktop.
Save matiaskorhonen/465413 to your computer and use it in GitHub Desktop.
gem "resque", :require => "resque/server"
class Authentication
def initialize(app)
@app = app
end
def call(env)
env['warden'].authenticate!(:database_authenticatable, :rememberable, :scope => :admin)
@app.call(env)
end
end
Resque::Server.use Authentication
mount Resque::Server.new, :at => "/resque"
authenticate :admin do
mount Resque::Server.new, :at => "/resque"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment