Created
November 12, 2009 07:31
-
-
Save rgm/232690 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
class TemporaryBasicAuth | |
def initialize(app) | |
@app = Rack::Auth::Basic.new(app) do |username,password| | |
(username == 'someguy') and (password == 'mypassword') | |
end | |
@app.realm = "Your realm here" | |
end | |
def call(env) | |
return @app.call(env) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment