UNPKG

secure-scan-js

Version:

A JavaScript implementation of Yelp's detect-secrets tool - no Python required

21 lines (18 loc) 730 B
#!/usr/bin/env node const auth = require('../src/auth-web'); const chalk = require('chalk'); console.log(chalk.cyan('=======================')); console.log(chalk.cyan('CLI Authentication Tool')); console.log(chalk.cyan('=======================')); // Start the login flow auth.login() .then(tokenData => { console.log(chalk.green('\n✅ Authentication successful!')); console.log(chalk.green(`Token will expire in ${auth.config.tokenExpirationSeconds} seconds`)); console.log(chalk.green(`Expiration: ${new Date(tokenData.expiresAt * 1000).toLocaleString()}`)); process.exit(0); }) .catch(error => { console.error(chalk.red('\n❌ Authentication failed:'), error.message); process.exit(1); });