Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Executing all sign_out function regardless of logged in users presence

  • Loading branch information...
commit 17bae5bba21c153ad1019fd754a6873d1a427b97 1 parent 1a41fff
Rodrigo Flores authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/devise/controllers/helpers.rb
View
5 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
Please sign in to comment.
Something went wrong with that request. Please try again.