Skip to content

Commit 8d268f6

Browse files
thomasballingerConvex, Inc.
authored andcommitted
fix loginFlow flag of cli login (#36445)
The missing behavior was announced in the changelog but not tested, the customer that needed it at the time realized they could use another approach. GitOrigin-RevId: d47e5bc3a836886d6127bd4388cef2648eb9614c
1 parent 0824d00 commit 8d268f6

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

npm-packages/convex/CHANGELOG.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
- The `npx convex login --login-flow paste` flag can be used to explicitly opt
6+
into the manual token paste login method.
7+
38
## 1.23.0
49

510
- `npx convex dev` now supports the option of running Convex locally without an
@@ -29,9 +34,6 @@
2934
- Calling registered functions directly like helper functions no longer
3035
typechecks. See release notes for 1.18.0 for more.
3136

32-
- The `npx convex login --auth-flow paste` flag can be used to explicitly opt
33-
into the manual token paste login method.
34-
3537
- Upgrade esbuild for a sourcemap bug fix.
3638

3739
- Fix FieldTypeFromFieldPath to handle union of nested values and primitives.

npm-packages/convex/src/cli/lib/login.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ export async function performLogin(
286286
overrideAuthUsername,
287287
overrideAuthPassword,
288288
overrideAccessToken,
289-
authFlow,
289+
loginFlow,
290290
open,
291291
acceptOptIns,
292292
dumpAccessToken,
@@ -298,7 +298,7 @@ export async function performLogin(
298298
overrideAuthUsername?: string;
299299
overrideAuthPassword?: string;
300300
overrideAccessToken?: string;
301-
authFlow?: "auto" | "paste" | "poll";
301+
loginFlow?: "auto" | "paste" | "poll";
302302
// default `true`
303303
open?: boolean;
304304
// default `false`
@@ -308,7 +308,7 @@ export async function performLogin(
308308
anonymousId?: string;
309309
} = {},
310310
) {
311-
authFlow = authFlow || "auto";
311+
loginFlow = loginFlow || "auto";
312312
// Get access token from big-brain
313313
// Default the device name to the hostname, but allow the user to change this if the terminal is interactive.
314314
// On Macs, the `hostname()` may be a weirdly-truncated form of the computer name. Attempt to read the "real" name before falling back to hostname.
@@ -338,7 +338,7 @@ export async function performLogin(
338338
let auth0;
339339
let accessToken: string;
340340

341-
if (authFlow === "paste" || (authFlow === "auto" && isWebContainer())) {
341+
if (loginFlow === "paste" || (loginFlow === "auto" && isWebContainer())) {
342342
accessToken = await promptString(ctx, {
343343
message:
344344
"Open https://dashboard.convex.dev/auth, log in and paste the token here:",

0 commit comments

Comments
 (0)