Sha256: f07bf8bfb58d201a002b1a50fae78c29d3e36c5546bf5b76a7bfaff0a515f4cc
Contents?: true
Size: 755 Bytes
Versions: 8
Compression:
Stored size: 755 Bytes
Contents
module Brightbox module Config module TwoFactorAuth def extend_with_two_factor_pin(password) if two_factor_enabled suffix = "+" + two_factor_pin password += suffix unless password.end_with?(suffix) end password end private def two_factor_enabled return config[client_name]["two_factor"] == "true" unless client_name.nil? end def two_factor_pin @two_factor_pin ||= prompt_for_two_factor_pin if two_factor_enabled end def prompt_for_two_factor_pin require "highline" highline = HighLine.new # FIXME: Capture interupts if user aborts highline.ask("Enter your two factor pin : ") end end end end
Version data entries
8 entries across 8 versions & 1 rubygems