summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpaulrogers <pmr16366@gmail.com>2016-03-16 20:16:15 -0600
committerpaulrogers <pmr16366@gmail.com>2016-03-16 20:16:15 -0600
commite9550639ebda9b8deed6b695f5a3d805c0d197c9 (patch)
treed65d0f3d0c0a0141d7f68183d3b3d398922e23b3
parent22aaf0e09adfb955dfb93bc03b621dc269447d03 (diff)
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
-rw-r--r--lib/tfa/totp_command.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/tfa/totp_command.rb b/lib/tfa/totp_command.rb
index bba1eb9..8dd0125 100644
--- a/lib/tfa/totp_command.rb
+++ b/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