Skip to content

Instantly share code, notes, and snippets.

@balupton
Created April 3, 2017 00:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save balupton/4fb0c82a1d7fc0c4a5636444446e0aa0 to your computer and use it in GitHub Desktop.
Save balupton/4fb0c82a1d7fc0c4a5636444446e0aa0 to your computer and use it in GitHub Desktop.
'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