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:
parent
1a41fff009
commit
17bae5bba2
1 changed files with 3 additions and 2 deletions
|
@ -137,12 +137,13 @@ module Devise
|
|||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue