Skip to content

Instantly share code, notes, and snippets.

@balupton
Created April 3, 2017 00:21
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
'use strict'
const OTPAuth = require('otpauth')
const thing = OTPAuth.URI.parse('otpauth://totp/Patreon:email?secret=SECRET&issuer=Patreon')
const customTOTP = new OTPAuth.TOTP(thing)
// Convert to Google Authenticator key URI
console.log(customTOTP.toString())
// Generate token
console.log(customTOTP.generate())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment