Permalink
Browse files

Executing all sign_out function regardless of logged in users presence

  • Loading branch information...
1 parent 1a41fff commit 17bae5bba21c153ad1019fd754a6873d1a427b97 Rodrigo Flores committed Feb 16, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/devise/controllers/helpers.rb
@@ -137,12 +137,13 @@ def sign_in(resource_or_scope, *args)
def sign_out(resource_or_scope=nil)
return sign_out_all_scopes unless resource_or_scope
scope = Devise::Mapping.find_scope!(resource_or_scope)
- return false unless warden.user(:scope => scope, :run_callbacks => false) # If there is no
+ user = warden.user(:scope => scope, :run_callbacks => false) # If there is no user
warden.raw_session.inspect # Without this inspect here. The session does not clear.
warden.logout(scope)
instance_variable_set(:"@current_#{scope}", nil)
- true
+
+ !!user
end
# Sign out all active users or scopes. This helper is useful for signing out all roles

0 comments on commit 17bae5b

Please sign in to comment.