You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: totp.rb
    path of file: ./repos/openproject/modules/two_factor_authentication/app/models/two_factor_authentication/device
    
    the code of the file until where you have to start completion: require 'rotp'

module TwoFactorAuthentication
  class Device::Totp < Device
    validates_presence_of :otp_secret

    def self.device_type
      :totp
    end

    # Check allowed
    
    def verify_token(token)
      result = totp.verify(token.to_s, drift_behind: allowed_drift, drift_ahead: allowed_drift, after: last_used_at)

      if result.nil?
        false
      else
        update_column(:last_used_at, result)
        true
      end