Sha256: e98d0284412aed957c13f311f1fef1861ec9e7d20c16dcbdd84ab8ba408a26bc

Contents?: true

Size: 684 Bytes

Versions: 20

Compression:

Stored size: 684 Bytes

Contents

require "vmc/cli/v2_check_cli"

module VMC
  module User
    class Base < V2CheckCLI
      def precondition
        check_logged_in
      end

      private

      def validate_password!(password)
        validate_password_verified!(password)
        validate_password_strength!(password)
      end

      def validate_password_verified!(password)
        fail "Passwords do not match." unless force? || password == input[:verify]
      end

      def validate_password_strength!(password)
        strength = client.base.password_score(password)
        msg = "Your password strength is: #{strength}"
        fail msg if strength == :weak
        line msg
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
cloulu-1.0.0 lib/vmc/cli/user/base.rb
cloulu-0.7.0 lib/vmc/cli/user/base.rb
cloulu-0.6.6 lib/vmc/cli/user/base.rb
cloulu-0.6.5 lib/vmc/cli/user/base.rb
cloulu-0.6.1 lib/vmc/cli/user/base.rb
cloulu-0.6.0 lib/vmc/cli/user/base.rb
cloulu-0.5.1 lib/vmc/cli/user/base.rb
cloulu-0.5.0 lib/vmc/cli/user/base.rb
cloulu-0.3.0 lib/vmc/cli/user/base.rb
cloulu-0.2.6 lib/vmc/cli/user/base.rb
cloulu-0.2.5 lib/vmc/cli/user/base.rb
cloulu-0.2.4 lib/vmc/cli/user/base.rb
cloulu-0.2.3 lib/vmc/cli/user/base.rb
cloulu-0.2.1 lib/vmc/cli/user/base.rb
cloulu-0.2.0 lib/vmc/cli/user/base.rb
cloulu-0.1.6 lib/vmc/cli/user/base.rb
cloulu-0.1.5 lib/vmc/cli/user/base.rb
cloulu-0.1.2 lib/vmc/cli/user/base.rb
cloulu-0.1.1 lib/vmc/cli/user/base.rb
vmc-0.5.1 lib/vmc/cli/user/base.rb