Commit e955063

paulrogers <pmr16366@gmail.com>
2016-03-17 02:16:15
Update totp_command.rb
adds a rescue round where totp parse the value. If its been entered incorrectly, will just display ?? instead of crapping out
1 parent 22aaf0e
Changed files (1)
lib/tfa/totp_command.rb
@@ -12,7 +12,11 @@ module TFA
     private
 
     def password_for(secret)
-      ::ROTP::TOTP.new(secret).now
+      begin
+        ::ROTP::TOTP.new(secret).now
+      rescue
+        "???"
+      end  
     end
 
     def all_passwords