lib/devise_two_factor/models/two_factor_authenticatable.rb
# An OTP cannot be used more than once in a given timestep
# Storing timestep of last valid OTP is sufficient to satisfy this requirement
An OTP cannot be used more than once in a given timestep
Storing timestep of last valid OTP is sufficient to satisfy this requirement
An OTP cannot be used more than once in a given timestep Storing timestep of last valid OTP is sufficient to satisfy this requirement
def consume_otp!
        if self.consumed_timestep != current_otp_timestep
          self.consumed_timestep = current_otp_timestep
          return save(validate: false)
        end
        false
      end
def consume_otp! if self . consumed_timestep != current_otp_timestep self . consumed_timestep = current_otp_timestep return save ( validate : false ) end false end
An OTP cannot be used more than once in a given timestep
Storing timestep of last valid OTP is sufficient to satisfy this requirement
An OTP cannot be used more than once in a given timestep Storing timestep of last valid OTP is sufficient to satisfy this requirement