Sha256: 0d0ec0aab4f9fe56a181ec7d7f2b77008feb4e89c1a0577a36cb8e32f7e6ba16

Contents?: true

Size: 503 Bytes

Versions: 5

Compression:

Stored size: 503 Bytes

Contents

# frozen_string_literal: true

module Masks
  module Credentials
    # Checks :password for a match.
    class Password < Masks::Credential
      checks :password

      def lookup
        actor.password = password if actor&.new_record? && password

        nil
      end

      def maskup
        return unless password

        actor&.authenticate(password) && actor&.valid? ? approve! : deny!
      end

      private

      def password
        session_params[:password]
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
masks-0.4.0 app/models/masks/credentials/password.rb
masks-0.3.2 app/models/masks/credentials/password.rb
masks-0.3.1 app/models/masks/credentials/password.rb
masks-0.3.0 app/models/masks/credentials/password.rb
masks-0.2.0 app/models/masks/credentials/password.rb