Skip to content

Commit

Permalink
Merge pull request pelle#137 from thetizzo/master
Browse files Browse the repository at this point in the history
allow? should return false if no token is found
  • Loading branch information
pelle committed Sep 24, 2013
2 parents 9899278 + 9c5cbb5 commit 5c2b591
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/oauth/controllers/application_controller_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,12 @@ def allow?
if @strategies.include?(:interactive) && interactive
true
elsif !(@strategies & env["oauth.strategies"].to_a).empty?
@controller.send :current_user=, token.user if token
true
if token.present?
@controller.send :current_user=, token.user
true
else
false
end
else
if @strategies.include?(:interactive)
controller.send :access_denied
Expand Down

0 comments on commit 5c2b591

Please sign in to comment.