Skip to content

Commit

Permalink
check to make sure request is not ajax before setting return url
Browse files Browse the repository at this point in the history
fixes #743
  • Loading branch information
Ch4s3 committed Jan 27, 2016
1 parent 3aecfc9 commit 51e7c50
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 51e7c50

Please sign in to comment.