Skip to content

Commit

Permalink
Bypass authorization if no credentials were given
Browse files Browse the repository at this point in the history
  • Loading branch information
jtreitz committed Jul 10, 2012
1 parent 4354924 commit 69c6ba2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/clearance_http_auth/middleware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def initialize(app)
# if the incoming request is targeting the API.
#
def call(env)
if targeting_api?(env)
if targeting_api?(env) and env['HTTP_AUTHORIZATION']
@app = Rack::Auth::Basic.new(@app) do |username, password|
env[:clearance].sign_in ::User.authenticate(username, password)
end
Expand Down

0 comments on commit 69c6ba2

Please sign in to comment.