Skip to content

Commit

Permalink
Moved auth method to Sinatra::EventContext class
Browse files Browse the repository at this point in the history
  • Loading branch information
bomberstudios committed Dec 15, 2008
1 parent ac16acb commit 61bc76d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/auth.rb
Expand Up @@ -51,11 +51,10 @@ def authentication_request(realm)
module Sinatra
class EventContext
include HttpAuthentication::Basic
def auth
authenticate_or_request_with_http_basic do |user_name, password|
user_name == Sinatra.options.username && Digest::SHA1.hexdigest(password) == Sinatra.options.password
end if Sinatra.options.use_auth
end
end
end

def auth
authenticate_or_request_with_http_basic do |user_name, password|
user_name == Sinatra.options.username && Digest::SHA1.hexdigest(password) == Sinatra.options.password
end if Sinatra.options.use_auth
end

0 comments on commit 61bc76d

Please sign in to comment.