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

Executing all sign_out function regardless of logged in users presence

This commit is contained in:
Rodrigo Flores 2012-02-16 15:30:12 -02:00
parent 1a41fff009
commit 17bae5bba2

View file

@ -137,12 +137,13 @@ module Devise
def sign_out(resource_or_scope=nil) def sign_out(resource_or_scope=nil)
return sign_out_all_scopes unless resource_or_scope return sign_out_all_scopes unless resource_or_scope
scope = Devise::Mapping.find_scope!(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.raw_session.inspect # Without this inspect here. The session does not clear.
warden.logout(scope) warden.logout(scope)
instance_variable_set(:"@current_#{scope}", nil) instance_variable_set(:"@current_#{scope}", nil)
true
!!user
end end
# Sign out all active users or scopes. This helper is useful for signing out all roles # Sign out all active users or scopes. This helper is useful for signing out all roles