class Lato::User
def authenticator(params)
def authenticator(params) return false unless authenticator_enabled? totp = ROTP::TOTP.new(authenticator_secret) result = totp.verify(params[:authenticator_code]) unless result errors.add(:base, :authenticator_code_invalid) return end true end