Sha256: 9494e9c31f7464616c2e4f0ba8a5a00743daa8a8a4bc7ad2b7c25ac7f3e16b09

Contents?: true

Size: 441 Bytes

Versions: 16

Compression:

Stored size: 441 Bytes

Contents

module Workarea
  class RemoveAuthenticationTokensOnPasswordChanges
    include Sidekiq::Worker
    include Sidekiq::CallbacksWorker

    sidekiq_options(
      enqueue_on: {
        User => [:save],
        ignore_if: -> { new_record? || changes['password_digest'].blank? },
        with: -> { [id] }
      },
      unique: :until_executing
    )

    def perform(id)
      User.find(id).authentication_tokens.destroy_all
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
workarea-api-4.5.6 storefront/app/workers/workarea/remove_authentication_tokens_on_password_changes.rb
workarea-api-storefront-4.5.6 app/workers/workarea/remove_authentication_tokens_on_password_changes.rb
workarea-api-4.5.5 storefront/app/workers/workarea/remove_authentication_tokens_on_password_changes.rb
workarea-api-storefront-4.5.5 app/workers/workarea/remove_authentication_tokens_on_password_changes.rb
workarea-api-4.5.4 storefront/app/workers/workarea/remove_authentication_tokens_on_password_changes.rb
workarea-api-storefront-4.5.4 app/workers/workarea/remove_authentication_tokens_on_password_changes.rb
workarea-api-4.5.3 storefront/app/workers/workarea/remove_authentication_tokens_on_password_changes.rb
workarea-api-storefront-4.5.3 app/workers/workarea/remove_authentication_tokens_on_password_changes.rb
workarea-api-4.5.2 storefront/app/workers/workarea/remove_authentication_tokens_on_password_changes.rb
workarea-api-storefront-4.5.2 app/workers/workarea/remove_authentication_tokens_on_password_changes.rb
workarea-api-4.5.0 storefront/app/workers/workarea/remove_authentication_tokens_on_password_changes.rb
workarea-api-storefront-4.5.0 app/workers/workarea/remove_authentication_tokens_on_password_changes.rb
workarea-api-4.4.7 storefront/app/workers/workarea/remove_authentication_tokens_on_password_changes.rb
workarea-api-storefront-4.4.7 app/workers/workarea/remove_authentication_tokens_on_password_changes.rb
workarea-api-4.4.6 storefront/app/workers/workarea/remove_authentication_tokens_on_password_changes.rb
workarea-api-storefront-4.4.6 app/workers/workarea/remove_authentication_tokens_on_password_changes.rb