Skip to content

Commit

Permalink
Gather user's ips from the CF-Connecting-IP header because of CloudFl…
Browse files Browse the repository at this point in the history
…are.
  • Loading branch information
abnerqian committed May 29, 2016
1 parent 47b16d1 commit 0c16477
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/users_controller.rb
Expand Up @@ -17,7 +17,7 @@ class UsersController < ApplicationController
create! do |success, failure|
success.html {
user = UserSession.find.record
user.ip_address = request.remote_ip
user.ip_address = request.headers["CF-Connecting-IP"] || request.remote_ip
user.save

redirect_back_or_default root_path
Expand Down

0 comments on commit 0c16477

Please sign in to comment.