Skip to content

Instantly share code, notes, and snippets.

@rgm
Created November 12, 2009 07:31
Show Gist options
  • Save rgm/232690 to your computer and use it in GitHub Desktop.
Save rgm/232690 to your computer and use it in GitHub Desktop.
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