Created
July 6, 2010 14:05
-
-
Save matiaskorhonen/465413 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem "resque", :require => "resque/server" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mount Resque::Server.new, :at => "/resque" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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