Skip to content

Commit

Permalink
Merge pull request #747 from Ch4s3/patch-1
Browse files Browse the repository at this point in the history
check to make sure request is not ajax before setting return url
  • Loading branch information
arnvald committed May 28, 2016
2 parents ea9bd30 + 51e7c50 commit a7d9786
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sorcery/controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module InstanceMethods
# If all attempts to auto-login fail, the failure callback will be called.
def require_login
if !logged_in?
session[:return_to_url] = request.url if Config.save_return_to_url && request.get?
session[:return_to_url] = request.url if Config.save_return_to_url && request.get? && !request.xhr?
self.send(Config.not_authenticated_action)
end
end
Expand Down

0 comments on commit a7d9786

Please sign in to comment.