Skip to content

Commit 9e9df34

Browse files
authored
Merge branch 'main' into k/partial-revert
2 parents 14fea34 + 0ec60de commit 9e9df34

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

‎cmd/src/login.go‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,11 @@ func loginCmd(ctx context.Context, p loginParams) error {
110110
}
111111

112112
_, flow := selectLoginFlow(p)
113-
return flow(ctx, p)
113+
if err := flow(ctx, p); err != nil {
114+
return err
115+
}
116+
fmt.Fprintf(p.out, "\n💡 Tip: To use this endpoint in your shell, run:\n\n export SRC_ENDPOINT=%s\n\n", p.cfg.endpointURL)
117+
return nil
114118
}
115119

116120
// selectLoginFlow decides what login flow to run based on configured AuthMode.

‎cmd/src/login_test.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func TestLogin(t *testing.T) {
115115
if err != nil {
116116
t.Fatal(err)
117117
}
118-
wantOut := "✔︎ Authenticated as alice on $ENDPOINT"
118+
wantOut := "✔︎ Authenticated as alice on $ENDPOINT\n\n\n💡 Tip: To use this endpoint in your shell, run:\n\n export SRC_ENDPOINT=$ENDPOINT"
119119
wantOut = strings.ReplaceAll(wantOut, "$ENDPOINT", s.URL)
120120
if out != wantOut {
121121
t.Errorf("got output %q, want %q", out, wantOut)
@@ -156,7 +156,7 @@ func TestLogin(t *testing.T) {
156156
t.Fatal("expected stored oauth token to avoid device flow")
157157
}
158158
gotOut := strings.TrimSpace(out.String())
159-
wantOut := "✔︎ Authenticated as alice on $ENDPOINT\n\n\n✔︎ Authenticated with OAuth credentials"
159+
wantOut := "✔︎ Authenticated as alice on $ENDPOINT\n\n\n✔︎ Authenticated with OAuth credentials\n\n💡 Tip: To use this endpoint in your shell, run:\n\n export SRC_ENDPOINT=$ENDPOINT"
160160
wantOut = strings.ReplaceAll(wantOut, "$ENDPOINT", s.URL)
161161
if gotOut != wantOut {
162162
t.Errorf("got output %q, want %q", gotOut, wantOut)

0 commit comments

Comments
 (0)