Skip to content

Commit 311a132

Browse files
committed
simplify approach
1 parent 99925c9 commit 311a132

2 files changed

Lines changed: 10 additions & 11 deletions

File tree

auth.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,10 @@ export function createTrpcClient(debug: boolean, deployUrl: string) {
7070
}
7171

7272
if (tokenIsTemp) {
73-
if (token_storage.get()?.startsWith("ddo_")) {
74-
error(
75-
debug,
76-
"Organization tokens cannot be used for the 'deno deploy' subcommand.",
77-
);
78-
} else {
79-
error(
80-
debug,
81-
"The token specified via 'DENO_DEPLOY_TOKEN' or the '--token' flag is invalid.",
82-
);
83-
}
73+
error(
74+
debug,
75+
"The token specified via 'DENO_DEPLOY_TOKEN' or the '--token' flag is invalid.",
76+
);
8477
}
8578

8679
if (typeof retryPromise !== "undefined") {

main.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,12 @@ deploy your local directory to the specified application.`)
281281
}
282282
const tokenEnv = options.token || Deno.env.get("DENO_DEPLOY_TOKEN");
283283
if (tokenEnv) {
284+
if (tokenEnv.startsWith("ddo_")) {
285+
error(
286+
options.debug,
287+
"Organization tokens cannot be used for the 'deno deploy' subcommand.",
288+
);
289+
}
284290
token_storage.set(tokenEnv, true);
285291
}
286292
})

0 commit comments

Comments
 (0)