aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/base/http_authentication.rb
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2009-05-18 11:18:46 -0300
committerEmilio Tagua <miloops@gmail.com>2009-05-18 11:18:46 -0300
commita04dedd5634cbb602cf48938cee0ff11c046b4c2 (patch)
tree66c51731cc283310362db57503d4952e0a0213bb /actionpack/lib/action_controller/base/http_authentication.rb
parent0048897a417774f7e5a0c8c9e82fc8684f94ebc1 (diff)
parent27de7f150b57a18d4ccdd274f6f8b621b58108c6 (diff)
downloadrails-a04dedd5634cbb602cf48938cee0ff11c046b4c2.tar.gz
rails-a04dedd5634cbb602cf48938cee0ff11c046b4c2.tar.bz2
rails-a04dedd5634cbb602cf48938cee0ff11c046b4c2.zip
Merge commit 'rails/master'
Conflicts: activerecord/lib/active_record/base.rb activerecord/lib/active_record/migration.rb activerecord/test/cases/helper.rb
Diffstat (limited to 'actionpack/lib/action_controller/base/http_authentication.rb')
-rw-r--r--actionpack/lib/action_controller/base/http_authentication.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/base/http_authentication.rb b/actionpack/lib/action_controller/base/http_authentication.rb
index b6b5267c66..fa8ecea408 100644
--- a/actionpack/lib/action_controller/base/http_authentication.rb
+++ b/actionpack/lib/action_controller/base/http_authentication.rb
@@ -1,3 +1,5 @@
+require 'active_support/base64'
+
module ActionController
module HttpAuthentication
# Makes it dead easy to do HTTP Basic authentication.
@@ -276,7 +278,7 @@ module ActionController
t = time.to_i
hashed = [t, secret_key]
digest = ::Digest::MD5.hexdigest(hashed.join(":"))
- Base64.encode64("#{t}:#{digest}").gsub("\n", '')
+ ActiveSupport::Base64.encode64("#{t}:#{digest}").gsub("\n", '')
end
# Might want a shorter timeout depending on whether the request
@@ -285,7 +287,7 @@ module ActionController
# allow a user to use new nonce without prompting user again for their
# username and password.
def validate_nonce(request, value, seconds_to_timeout=5*60)
- t = Base64.decode64(value).split(":").first.to_i
+ t = ActiveSupport::Base64.decode64(value).split(":").first.to_i
nonce(t) == value && (t - Time.now.to_i).abs <= seconds_to_timeout
end