File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
components/gitpod-cli/cmd Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -46,11 +46,16 @@ var credentialHelper = &cobra.Command{
46
46
defer func () {
47
47
// Credentials not found, return `quit=true` so no further helpers will be consulted, nor will the user be prompted.
48
48
// From https://git-scm.com/docs/gitcredentials#_custom_helpers
49
- if user == "" || token == "" {
49
+ if token == "" {
50
50
fmt .Print ("quit=true\n " )
51
- } else {
52
- fmt .Printf ("username=%s\n password=%s\n " , user , token )
51
+ return
53
52
}
53
+ // Server could return only the token and not the username, so we fallback to hardcoded `oauth2` username.
54
+ // See https://github.com/gitpod-io/gitpod/pull/7889#discussion_r801670957
55
+ if user == "" {
56
+ user = "oauth2"
57
+ }
58
+ fmt .Printf ("username=%s\n password=%s\n " , user , token )
54
59
}()
55
60
56
61
host , err := parseHostFromStdin ()
You can’t perform that action at this time.
0 commit comments