Sha256: 148b68a9f68ef6cded45a2f774db73a51b5706cc703ec6019d7a5bc1d19baff6

Contents?: true

Size: 573 Bytes

Versions: 23

Compression:

Stored size: 573 Bytes

Contents

# frozen-string-literal: true

module Rodauth
  Feature.define(:update_password_hash, :UpdatePasswordHash) do
    depends :login_password_requirements_base

    def password_match?(password)
      if (result = super) && update_password_hash?
        set_password(password)
      end

      result
    end

    private

    def update_password_hash?
      password_hash_cost != @current_password_hash_cost
    end

    def get_password_hash
      if hash = super
        @current_password_hash_cost = extract_password_hash_cost(hash)
      end

      hash
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
rodauth-2.31.0 lib/rodauth/features/update_password_hash.rb
rodauth-2.30.0 lib/rodauth/features/update_password_hash.rb
rodauth-2.29.0 lib/rodauth/features/update_password_hash.rb
rodauth-2.28.0 lib/rodauth/features/update_password_hash.rb
rodauth-2.27.0 lib/rodauth/features/update_password_hash.rb
rodauth-2.26.1 lib/rodauth/features/update_password_hash.rb
rodauth-2.26.0 lib/rodauth/features/update_password_hash.rb
rodauth-2.25.0 lib/rodauth/features/update_password_hash.rb
rodauth-2.24.0 lib/rodauth/features/update_password_hash.rb
rodauth-2.23.0 lib/rodauth/features/update_password_hash.rb
rodauth-2.22.0 lib/rodauth/features/update_password_hash.rb
rodauth-2.21.0 lib/rodauth/features/update_password_hash.rb
rodauth-2.20.0 lib/rodauth/features/update_password_hash.rb
rodauth-2.19.0 lib/rodauth/features/update_password_hash.rb
rodauth-2.18.0 lib/rodauth/features/update_password_hash.rb
rodauth-2.17.0 lib/rodauth/features/update_password_hash.rb
rodauth-2.16.0 lib/rodauth/features/update_password_hash.rb
rodauth-2.15.0 lib/rodauth/features/update_password_hash.rb
rodauth-2.14.0 lib/rodauth/features/update_password_hash.rb
rodauth-2.13.0 lib/rodauth/features/update_password_hash.rb