Skip to content

Commit 21031b7

Browse files
authored
fix(login): default to yes when prompting to log in (#291)
1 parent 6aece4f commit 21031b7

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

pkg/auth/auth.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,13 @@ func (t Auth) PromptForLogin() (*LoginTokens, error) {
182182

183183
func shouldLogin() (bool, error) {
184184
reader := bufio.NewReader(os.Stdin) // TODO 9 inject?
185-
fmt.Print(`You are currently logged out, would you like to log in? [y/n]: `)
185+
fmt.Print(`You are currently logged out, would you like to log in? [Y/n]: `)
186186
text, err := reader.ReadString('\n')
187187
if err != nil {
188188
return false, breverrors.WrapAndTrace(err)
189189
}
190-
return strings.ToLower(strings.TrimSpace(text)) == "y", nil
190+
trimmed := strings.ToLower(strings.TrimSpace(text))
191+
return trimmed == "y" || trimmed == "", nil
191192
}
192193

193194
func (t Auth) LoginWithToken(token string) error {

0 commit comments

Comments
 (0)