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

Works on 3.0.4.

This commit is contained in:
José Valim 2011-02-15 10:26:28 +01:00
parent 6a6ed6702e
commit add8f8a203
6 changed files with 66 additions and 59 deletions

View file

@ -2,7 +2,7 @@ source "http://rubygems.org"
gemspec
gem "rails", "~> 3.0.0"
gem "rails", "~> 3.0.4"
gem "oa-oauth", :require => "omniauth/oauth"
gem "oa-openid", :require => "omniauth/openid"

View file

@ -10,60 +10,60 @@ GEM
remote: http://rubygems.org/
specs:
abstract (1.0.0)
actionmailer (3.0.3)
actionpack (= 3.0.3)
mail (~> 2.2.9)
actionpack (3.0.3)
activemodel (= 3.0.3)
activesupport (= 3.0.3)
actionmailer (3.0.4)
actionpack (= 3.0.4)
mail (~> 2.2.15)
actionpack (3.0.4)
activemodel (= 3.0.4)
activesupport (= 3.0.4)
builder (~> 2.1.2)
erubis (~> 2.6.6)
i18n (~> 0.4)
rack (~> 1.2.1)
rack-mount (~> 0.6.13)
rack-test (~> 0.5.6)
rack-test (~> 0.5.7)
tzinfo (~> 0.3.23)
activemodel (3.0.3)
activesupport (= 3.0.3)
activemodel (3.0.4)
activesupport (= 3.0.4)
builder (~> 2.1.2)
i18n (~> 0.4)
activerecord (3.0.3)
activemodel (= 3.0.3)
activesupport (= 3.0.3)
activerecord (3.0.4)
activemodel (= 3.0.4)
activesupport (= 3.0.4)
arel (~> 2.0.2)
tzinfo (~> 0.3.23)
activerecord-jdbc-adapter (1.0.2-java)
activerecord-jdbcsqlite3-adapter (1.0.2-java)
activerecord-jdbc-adapter (= 1.0.2)
activerecord-jdbc-adapter (1.1.1)
activerecord-jdbcsqlite3-adapter (1.1.1)
activerecord-jdbc-adapter (= 1.1.1)
jdbc-sqlite3 (~> 3.6.0)
activeresource (3.0.3)
activemodel (= 3.0.3)
activesupport (= 3.0.3)
activesupport (3.0.3)
addressable (2.2.2)
arel (2.0.4)
bcrypt-ruby (2.1.2)
bson (1.1.2)
activeresource (3.0.4)
activemodel (= 3.0.4)
activesupport (= 3.0.4)
activesupport (3.0.4)
addressable (2.2.4)
arel (2.0.8)
bcrypt-ruby (2.1.4)
bcrypt-ruby (2.1.4-java)
bson (1.2.1)
bson_ext (1.1.2)
builder (2.1.2)
columnize (0.3.2)
erubis (2.6.6)
abstract (>= 1.0.0)
faraday (0.5.2)
addressable (~> 2.2.2)
multipart-post (~> 1.0.1)
faraday (0.5.5)
addressable (~> 2.2.4)
multipart-post (~> 1.1.0)
rack (>= 1.1.0, < 2)
i18n (0.4.2)
i18n (0.5.0)
jdbc-sqlite3 (3.6.14.2.056-java)
linecache (0.43)
mail (2.2.10)
mail (2.2.15)
activesupport (>= 2.3.6)
i18n (~> 0.4.1)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.16)
mocha (0.9.9)
rake
mocha (0.9.12)
mongo (1.1.2)
bson (>= 1.1.1)
mongoid (2.0.0.beta.20)
@ -72,9 +72,9 @@ GEM
tzinfo (~> 0.3.22)
will_paginate (~> 3.0.pre)
multi_json (0.0.5)
multipart-post (1.0.1)
nokogiri (1.4.3.1)
nokogiri (1.4.3.1-java)
multipart-post (1.1.0)
nokogiri (1.4.4)
nokogiri (1.4.4-java)
weakling (>= 0.0.3)
oa-core (0.1.6)
rack (~> 1.1)
@ -89,10 +89,10 @@ GEM
rack-openid (~> 1.2.0)
ruby-openid-apps-discovery
oauth (0.4.4)
oauth2 (0.1.0)
oauth2 (0.1.1)
faraday (~> 0.5.0)
multi_json (~> 0.0.4)
orm_adapter (0.0.3)
orm_adapter (0.0.4)
polyglot (0.3.1)
rack (1.2.1)
rack-mount (0.6.13)
@ -100,19 +100,19 @@ GEM
rack-openid (1.2.0)
rack (>= 1.1.0)
ruby-openid (>= 2.1.8)
rack-test (0.5.6)
rack-test (0.5.7)
rack (>= 1.0)
rails (3.0.3)
actionmailer (= 3.0.3)
actionpack (= 3.0.3)
activerecord (= 3.0.3)
activeresource (= 3.0.3)
activesupport (= 3.0.3)
rails (3.0.4)
actionmailer (= 3.0.4)
actionpack (= 3.0.4)
activerecord (= 3.0.4)
activeresource (= 3.0.4)
activesupport (= 3.0.4)
bundler (~> 1.0)
railties (= 3.0.3)
railties (3.0.3)
actionpack (= 3.0.3)
activesupport (= 3.0.3)
railties (= 3.0.4)
railties (3.0.4)
actionpack (= 3.0.4)
activesupport (= 3.0.4)
rake (>= 0.8.7)
thor (~> 0.14.4)
rake (0.8.7)
@ -124,11 +124,13 @@ GEM
ruby-openid (2.1.8)
ruby-openid-apps-discovery (1.2.0)
ruby-openid (>= 2.1.7)
sqlite3-ruby (1.3.2)
sqlite3 (1.3.3)
sqlite3-ruby (1.3.3)
sqlite3 (>= 1.3.3)
thor (0.14.6)
treetop (1.4.9)
polyglot (>= 0.3.1)
tzinfo (0.3.23)
tzinfo (0.3.24)
warden (1.0.3)
rack (>= 1.0.0)
weakling (0.0.4-java)
@ -153,7 +155,7 @@ DEPENDENCIES
oa-oauth
oa-openid
orm_adapter (~> 0.0.3)
rails (~> 3.0.0)
rails (~> 3.0.4)
ruby-debug (>= 0.10.3)
sqlite3-ruby
warden (~> 1.0.3)

View file

@ -187,8 +187,9 @@ module Devise
@@stateless_token = false
# Which formats should be treated as navigational.
# We need both :"*/*" and "*/*" to work on different Rails versions.
mattr_accessor :navigational_formats
@@navigational_formats = [:"*/*", :html]
@@navigational_formats = [:"*/*", "*/*", :html]
# When set to true, signing out a user signs out all other scopes.
mattr_accessor :sign_out_all_scopes

View file

@ -64,7 +64,6 @@ module Devise
end
def redirect_url
request_format = request.format.to_sym
if request_format == :html
send(:"new_#{scope}_session_path")
else
@ -84,7 +83,7 @@ module Devise
if request.xhr?
Devise.http_authenticatable_on_xhr
else
!(request.format && Devise.navigational_formats.include?(request.format.to_sym))
!(request_format && Devise.navigational_formats.include?(request_format))
end
end
@ -95,8 +94,8 @@ module Devise
end
def http_auth_body
return i18n_message unless request.format
method = "to_#{request.format.to_sym}"
return i18n_message unless request_format
method = "to_#{request_format}"
{}.respond_to?(method) ? { :error => i18n_message }.send(method) : i18n_message
end
@ -128,5 +127,9 @@ module Devise
def store_location!
session["#{scope}_return_to"] = attempted_path if request.get? && !http_auth?
end
def request_format
@request_format ||= request.format.respond_to?(:ref) ? request.format.ref : request.format
end
end
end

View file

@ -161,8 +161,9 @@ Devise.setup do |config|
# If you have any extra navigational formats, like :iphone or :mobile, you
# should add them to the navigational formats lists.
#
# The :"*/*" format below is required to match Internet Explorer requests.
# config.navigational_formats = [:"*/*", :html]
# The :"*/*" and "*/*" formats below is required to match Internet
# Explorer requests.
# config.navigational_formats = [:"*/*", "*/*", :html]
# The default HTTP method used to sign out a resource. Default is :get.
# config.sign_out_via = :get

View file

@ -13,7 +13,7 @@ class FailureTest < ActiveSupport::TestCase
'REQUEST_METHOD' => 'GET',
'warden.options' => { :scope => :user },
'rack.session' => {},
'action_dispatch.request.formats' => Array(env_params.delete('formats') || :html),
'action_dispatch.request.formats' => Array(env_params.delete('formats') || Mime::HTML),
'rack.input' => "",
'warden' => OpenStruct.new(:message => nil)
}.merge!(env_params)