diff --git a/src/hooks/prerun/auth_check.ts b/src/hooks/prerun/auth_check.ts index c9d49874..2bf63d7e 100644 --- a/src/hooks/prerun/auth_check.ts +++ b/src/hooks/prerun/auth_check.ts @@ -10,12 +10,20 @@ import { AuthService } from '../../services/auth.service'; import Webdav from '../../commands/webdav'; import WebDAVConfig from '../../commands/webdav-config'; -const CommandsToSkip = [Whoami, Login, LoginLegacy, Logout, Logs, Webdav, WebDAVConfig]; +const Autocomplete = { + name: 'autocomplete', + id: 'autocomplete', +}; + +const CommandsToSkip = [Whoami, Login, LoginLegacy, Logout, Logs, Webdav, WebDAVConfig, Autocomplete]; const hook: Hook<'prerun'> = async function (opts) { const { Command, argv } = opts; const jsonFlag = argv.includes('--json'); - if (!CommandsToSkip.map((command) => command.name).includes(Command.name)) { + if ( + !CommandsToSkip.map((command) => command.name.toLowerCase()).includes(Command.name.toLowerCase()) && + !CommandsToSkip.map((command) => command.id.toLowerCase()).includes(Command.id.toLowerCase()) + ) { CLIUtils.doing('Checking credentials', jsonFlag); try { const { token } = await AuthService.instance.getAuthDetails();