Skip to content

Instantly share code, notes, and snippets.

@gunn
Created August 1, 2010 09:12
Show Gist options
  • Save gunn/503156 to your computer and use it in GitHub Desktop.
Save gunn/503156 to your computer and use it in GitHub Desktop.
Simple Authentication demo for IRC user
USER_ID, PASSWORD = "zara", "pass123"
before_filter :admin?, :only => [ :edit, :delete ]
def admin?
@is_admin ||= authenticate_or_request_with_http_basic do |id, password|
id == USER_ID && password == PASSWORD
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment