saget-auth-middleware
Version:
SSO Middleware dengan dukungan localStorage untuk validasi authentifikasi domain malinau.go.id dan semua subdomain pada aplikasi Next.js 14 & 15
47 lines (39 loc) ⢠908 B
JavaScript
import { setupEnvironment } from './setup.js';
const args = process.argv.slice(2);
const command = args[0];
function showHelp() {
console.log(`
š SAGET Auth Middleware CLI
Usage:
npx saget-auth-middleware <command>
Commands:
init Initialize SSO configuration in your project
help Show this help message
Examples:
npx saget-auth-middleware init
npx saget-auth-middleware help
`);
}
function handleCommand() {
switch (command) {
case 'init':
console.log('š Initializing SAGET SSO Middleware...');
setupEnvironment();
break;
case 'help':
case '--help':
case '-h':
showHelp();
break;
default:
if (!command) {
console.log('ā No command provided.');
} else {
console.log(`ā Unknown command: ${command}`);
}
showHelp();
process.exit(1);
}
}
handleCommand();