@@ -59,6 +59,8 @@ func NewCmdLogin(f *cmdutil.Factory, runF func(*LoginOptions) error) *cobra.Comm
5959
6060 The default authentication mode is a web-based browser flow. After completion, an
6161 authentication token will be stored internally.
62+ If a credential store is not found or there is an issue using it we will fallback to writing the token in plain text.
63+ See %[1]sgh auth status%[1]s for its stored location.
6264
6365 Alternatively, use %[1]s--with-token%[1]s to pass in a token on standard input.
6466 The minimum required scopes for the token are: "repo", "read:org".
@@ -127,7 +129,7 @@ func NewCmdLogin(f *cmdutil.Factory, runF func(*LoginOptions) error) *cobra.Comm
127129
128130 // secure storage became the default on 2023/4/04; this flag is left as a no-op for backwards compatibility
129131 var secureStorage bool
130- cmd .Flags ().BoolVar (& secureStorage , "secure-storage" , false , "Save authentication credentials in secure credential store" )
132+ cmd .Flags ().BoolVar (& secureStorage , "secure-storage" , false , "Save authentication credentials in secure credential store. " )
131133 _ = cmd .Flags ().MarkHidden ("secure-storage" )
132134
133135 cmd .Flags ().BoolVar (& opts .InsecureStorage , "insecure-storage" , false , "Save authentication credentials in plain text instead of credential store" )
@@ -172,7 +174,8 @@ func loginRun(opts *LoginOptions) error {
172174 return fmt .Errorf ("error validating token: %w" , err )
173175 }
174176 // Adding a user key ensures that a nonempty host section gets written to the config file.
175- return authCfg .Login (hostname , "x-access-token" , opts .Token , opts .GitProtocol , ! opts .InsecureStorage )
177+ configWriteError , _ := authCfg .Login (hostname , "x-access-token" , opts .Token , opts .GitProtocol , ! opts .InsecureStorage )
178+ return configWriteError
176179 }
177180
178181 existingToken , _ := authCfg .Token (hostname )
0 commit comments