Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
reesericci committed Oct 25, 2023
1 parent 7caeaaf commit a0dd15f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/user/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a0dd15f

Please sign in to comment.