lib/switch_user/provider/devise.rb in switch_user-1.3.1 vs lib/switch_user/provider/devise.rb in switch_user-1.4.0
- old
+ new
@@ -5,10 +5,14 @@
@controller = controller
@warden = @controller.warden
end
def login(user, scope = :user)
- @warden.session_serializer.store(user, scope)
+ if SwitchUser.provider.is_a?(Hash) && SwitchUser.provider[:store_sign_in]
+ @warden.set_user(user, scope: scope)
+ else
+ @warden.session_serializer.store(user, scope)
+ end
end
def logout(scope = :user)
@warden.logout(scope)
end