Handles the removing of authorizations, which includes deleting the auth file in the global .sfdx folder, deleting any configs that are associated with the username/alias, and deleting any aliases associated with the username

const remover = await AuthRemover.create();
await remover.removeAuth('example@mycompany.com');
const remover = await AuthRemover.create();
await remover.removeAllAuths();
const remover = await AuthRemover.create();
const auth = await remover.findAuth(
example@mycompany.com
);
await remover.removeAuth(auth.username);

Pass a projectPath to resolve local config from a specific project instead of process.cwd(), and skipCache to re-read config from disk when the process-cached aggregator can't be trusted:

const remover = await AuthRemover.create({ projectPath: '/path/to/project', skipCache: true });
await remover.removeAuth('example@mycompany.com');

Hierarchy

Constructors

Methods

  • Finds authorization files for username/alias in the global .sfdx folder Throws SfError{ name: 'TargetOrgNotSetError' } if no target-org Throws SfError{ name: 'NamedOrgNotFoundError' } if specified user is not found

    Parameters

    • OptionalusernameOrAlias: string

      username or alias of the auth you want to find, defaults to the configured target-org

    Returns Promise<AuthFields>

  • Removes all authentication files and any configs or aliases associated with them

    Returns Promise<void>

  • Removes the authentication and any configs or aliases associated with it

    Parameters

    • usernameOrAlias: string

      the username or alias that you want to remove

    Returns Promise<void>