fix: allow command login to read api url from cli args (#1168)

* fix: allow login to read api url from args

* Create strong-phones-smoke.md

---------

Co-authored-by: Eric Allam <eallam@icloud.com>
This commit is contained in:
Michael Li
2024-06-18 03:43:42 -05:00
committed by GitHub
parent 85a543d8ec
commit e02320f65d
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"trigger.dev": patch
---
fix: allow command login to read api url from cli args
+1 -1
View File
@@ -78,7 +78,7 @@ export async function login(options?: LoginOptions): Promise<LoginResult> {
if (accessTokenFromEnv) {
const auth = {
accessToken: accessTokenFromEnv,
apiUrl: process.env.TRIGGER_API_URL ?? "https://api.trigger.dev",
apiUrl: process.env.TRIGGER_API_URL ?? opts.defaultApiUrl ?? "https://api.trigger.dev",
};
const apiClient = new CliApiClient(auth.apiUrl, auth.accessToken);
const userData = await apiClient.whoAmI();