Skip to content

Commit 6bb4dd7

Browse files
committed
Fixed messaging when trying to login with an existing invalid access token
1 parent 0b5a0be commit 6bb4dd7

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

packages/cli-v3/src/commands/login.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,19 @@ export async function login(options?: LoginOptions): Promise<LoginResult> {
113113
);
114114

115115
if (!whoAmIResult.success) {
116-
prettyError("Whoami failed", whoAmIResult.error);
116+
prettyError("Unable to validate existing personal access token", whoAmIResult.error);
117117

118118
if (!opts.embedded) {
119-
outro("Login failed");
120-
}
119+
outro(
120+
`Login failed using stored token. To fix, first logout using \`trigger.dev logout${
121+
options?.profile ? ` --profile ${options.profile}` : ""
122+
}\` and then try again.`
123+
);
121124

122-
throw new Error(whoAmIResult.error);
125+
throw new SkipLoggingError(whoAmIResult.error);
126+
} else {
127+
throw new Error(whoAmIResult.error);
128+
}
123129
} else {
124130
if (!opts.embedded) {
125131
const continueOption = await select({

0 commit comments

Comments
 (0)