watson-ruby icon indicating copy to clipboard operation
watson-ruby copied to clipboard

Don't just check for blank password but invalid as well [lib/watson/github.rb]

Open nhmood opened this issue 11 years ago • 0 comments

filename : lib/watson/github.rb line # : 55 tag : todo md5 : 5f9156ff58811fb89fbad8bd977d2a4b

        # [todo] - Don't just check for blank password but invalid as well
        # Poor mans username/password grabbing
        print BOLD + "Username: " + RESET
        _username = $stdin.gets.chomp
        if _username.empty?
            Printer.print_status "x", RED
            print BOLD + "Input blank. Please enter your username!\n\n" + RESET
            return false
        end
            # [fix] - Crossplatform password block needed, not sure if current method is safe either
        # Block output to tty to prevent PW showing, Linux/Unix only :(
        print BOLD + "Password: " + RESET
        system "stty -echo"
        _password = $stdin.gets.chomp
        system "stty echo"
        print "\n\n"

nhmood avatar Nov 21 '13 16:11 nhmood