Example
Parameters: {"commit"=>"Log in", "action"=>"create", "controller"=>"sessions", "password"=>"password123", "login"=>"foobar"}
I know, this looks like a trivial matter but imagine anyone having access to our server looking at our production logs file. Passwords are left wide open for the whole world to see.
But no worries, just add this one liner in your application.rb
class ApplicationController < ActionController::Base
filter_parameter_logging "password"
end
Go back to your login form, fill in your login name and password and then submit.
Check out the logs and see the parameters hash.
Parameters: {"commit"=>"Log in", "action"=>"create", "controller"=>"sessions", "login"=>"foobar", "password"=>"[FILTERED]"}
Notice the hash key 'password'?
1 comment:
Cool bro! Thanks! :)
Post a Comment