##// END OF EJS Templates
Use ActiveSupport::SecureRandom to generate tokens (#3351)....
Jean-Philippe Lang -
r2641:3e523839887f
parent child
Show More
@@ -36,9 +36,6 class Token < ActiveRecord::Base
36
36
37 private
37 private
38 def self.generate_token_value
38 def self.generate_token_value
39 chars = ("a".."z").to_a + ("A".."Z").to_a + ("0".."9").to_a
39 ActiveSupport::SecureRandom.hex(20)
40 token_value = ''
41 40.times { |i| token_value << chars[rand(chars.size-1)] }
42 token_value
43 end
40 end
44 end
41 end
General Comments 0
You need to be logged in to leave comments. Login now