Instantly share code, notes, and snippets.

@balupton balupton/totp-auth.js Secret
Created Apr 3, 2017

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