1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Merge pull request #1087 from eMxyzptlk/patch-2

Rails has removed SecureRandom from ActiveSupport in Rails 3.2, deprecated
This commit is contained in:
José Valim 2011-05-23 23:49:59 -07:00
commit acd1c76c3b

View file

@ -3,6 +3,7 @@ require 'active_support/core_ext/numeric/time'
require 'active_support/dependencies'
require 'orm_adapter'
require 'set'
require 'securerandom'
module Devise
autoload :FailureApp, 'devise/failure_app'
@ -402,7 +403,7 @@ module Devise
# Generate a friendly string randomically to be used as token.
def self.friendly_token
ActiveSupport::SecureRandom.base64(15).tr('+/=', 'xyz')
SecureRandom.base64(15).tr('+/=', 'xyz')
end
# constant-time comparison algorithm to prevent timing attacks