forked from farhoodlabs/paperclip
Fix duplicate auth login company flag
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -0,0 +1,16 @@
|
|||||||
|
import { Command } from "commander";
|
||||||
|
import { describe, expect, it } from "vitest";
|
||||||
|
import { registerClientAuthCommands } from "../commands/client/auth.js";
|
||||||
|
|
||||||
|
describe("registerClientAuthCommands", () => {
|
||||||
|
it("registers auth commands without duplicate company-id flags", () => {
|
||||||
|
const program = new Command();
|
||||||
|
const auth = program.command("auth");
|
||||||
|
|
||||||
|
expect(() => registerClientAuthCommands(auth)).not.toThrow();
|
||||||
|
|
||||||
|
const login = auth.commands.find((command) => command.name() === "login");
|
||||||
|
expect(login).toBeDefined();
|
||||||
|
expect(login?.options.filter((option) => option.long === "--company-id")).toHaveLength(1);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -25,7 +25,6 @@ export function registerClientAuthCommands(auth: Command): void {
|
|||||||
auth
|
auth
|
||||||
.command("login")
|
.command("login")
|
||||||
.description("Authenticate the CLI for board-user access")
|
.description("Authenticate the CLI for board-user access")
|
||||||
.option("-C, --company-id <id>", "Request access for a specific company")
|
|
||||||
.option("--instance-admin", "Request instance-admin approval instead of plain board access", false)
|
.option("--instance-admin", "Request instance-admin approval instead of plain board access", false)
|
||||||
.action(async (opts: AuthLoginOptions) => {
|
.action(async (opts: AuthLoginOptions) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user