mirror of
https://github.com/withastro/astro.git
synced 2024-12-30 22:03:56 -05:00
Improve the unauthorized error output
This commit is contained in:
parent
e74c6445af
commit
26de0b878e
1 changed files with 2 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
import type { AstroConfig } from 'astro';
|
||||
import { mkdir, writeFile } from 'node:fs/promises';
|
||||
import { red } from 'kleur/colors';
|
||||
import { bgRed, cyan } from 'kleur/colors';
|
||||
import prompts from 'prompts';
|
||||
import type { Arguments } from 'yargs-parser';
|
||||
import { PROJECT_ID_FILE, getSessionIdFromFile } from '../../../tokens.js';
|
||||
|
@ -31,7 +31,7 @@ export async function cmd({ flags }: { config: AstroConfig; flags: Arguments })
|
|||
if (!response.ok) {
|
||||
// Unauthorized
|
||||
if(response.status === 401) {
|
||||
console.error(`${red('Unauthorized')}.\n\nAre you logged in? Run \`astro db login\` to authenticate and then try linking again.`);
|
||||
console.error(`${bgRed('Unauthorized')}\n\n Are you logged in?\n Run ${cyan('astro db login')} to authenticate and then try linking again.\n\n`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue