diff --git a/app/models/user/user.rb b/app/models/user/user.rb index 7a15f8d..e81df6f 100644 --- a/app/models/user/user.rb +++ b/app/models/user/user.rb @@ -16,7 +16,7 @@ def mint_otp end def use_otp(token) - if @hotp.verify(token.to_s, self.otp_counter.to_i) != nil && + if begin @hotp.verify(token.to_s, self.otp_counter.to_i) rescue nil end != nil && Time.now.to_i <= self.otp_last_minted + 600 then self.otp_last_minted = nil