diff --git a/cli/commands/whoami.mjs b/cli/commands/whoami.mjs index 4be3797c..5664bcaf 100644 --- a/cli/commands/whoami.mjs +++ b/cli/commands/whoami.mjs @@ -11,13 +11,13 @@ export default defineCommand({ async setup() { const config = loadConfig() if (!config.token) { - consola.log('Not currently logged in.') + consola.info('Not currently logged in.') return } - const user = await $api('/user') + const user = await $api('/user').catch(() => null) if (!user?.name) { - consola.log('Not currently logged in.') + consola.info('Not currently logged in.') return } consola.info(`Logged in as \`${user.name}\``) diff --git a/cli/utils.mjs b/cli/utils.mjs index adcabaab..3b72b171 100644 --- a/cli/utils.mjs +++ b/cli/utils.mjs @@ -8,7 +8,7 @@ import { ofetch } from 'ofetch' const CONFIG_DIR = XDGAppPaths('com.nuxt.hub.cli').dataDirs()[0] const CONFIG_PATH = join(CONFIG_DIR, 'auth.json') -export const NUXT_HUB_URL = process.env.NUXT_HUB_URL || 'http://nuxthub-admin.pages.dev' +export const NUXT_HUB_URL = process.env.NUXT_HUB_URL || 'https://nuxthub-admin.pages.dev' export function loadConfig() { try {