Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't pass options forward, this fixes uncaught warden error. Unfortu…
…nately could not write a test for it, although easily reproducible in Rails applications. Closes heartcombo#754
  • Loading branch information
josevalim committed Jan 3, 2011
1 parent 3f08665 commit 7ff0231
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.rdoc
Expand Up @@ -4,7 +4,6 @@
* bug fix
* Fix an issue causing infinite redirects in production
* rails g destroy works properly with devise generators (by github.com/andmej)
* recall options is now passed forward by hooks (by github.com/siong1987)
* before_failure callbacks should work on test helpers (by github.com/twinge)
* rememberable cookie now is httponly by default (by github.com/JamesFerguson)

Expand Down
5 changes: 3 additions & 2 deletions lib/devise/hooks/activatable.rb
Expand Up @@ -4,7 +4,8 @@
# in each request and in case the user is using other strategies beside Devise ones.
Warden::Manager.after_set_user do |record, warden, options|
if record && record.respond_to?(:active?) && !record.active?
warden.logout(options[:scope])
throw :warden, options.merge(:message => record.inactive_message)
scope = options[:scope]
warden.logout(scope)
throw :warden, :scope => scope, :message => record.inactive_message
end
end
2 changes: 1 addition & 1 deletion lib/devise/hooks/timeoutable.rb
Expand Up @@ -13,7 +13,7 @@
path_checker = Devise::PathChecker.new(warden.env, scope)
unless path_checker.signing_out?
warden.logout(scope)
throw :warden, options.merge(:message => :timeout)
throw :warden, :scope => scope, :message => :timeout
end
end

Expand Down

0 comments on commit 7ff0231

Please sign in to comment.