@dataroadinc/setup-auth
Version:
CLI tool and programmatic API for automated OAuth setup across cloud platforms
26 lines (25 loc) • 938 B
JavaScript
import { hookSaveEnvironmentVariables } from "../../../utils/env-handler.js";
import { gcpSetupOAuth } from "./setup.js";
export async function addCommandGcpSetupOAuth(program) {
program
.command("gcp-setup-oauth")
.description('[DEVELOPER] Per-deployment setup: Creates/updates OAuth clients for end-user authentication ("Login with Google")')
.hook("postAction", hookSaveEnvironmentVariables)
.action(async function _action() {
const options = {
...this.optsWithGlobals(),
};
try {
await gcpSetupOAuth(options);
}
catch (error) {
if (error instanceof Error) {
console.error("\n❌ Error during setup-oauth:\n" + error.toString());
}
else {
console.error("\n❌ Unknown error during setup-oauth:", error);
}
process.exit(1);
}
});
}