This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const crypto = require('crypto'); | |
function base64UrlDecode(value) { | |
const translated = value.replace(/-/g, '+').replace(/_/g, '/'); | |
const padding = translated.length % 4; | |
const padded = translated + '='.repeat(padding); | |
return Buffer.from(padded, 'base64'); | |
} | |
function decrypt(secret, token, ttl) { |