Skip to content

Commit

Permalink
fix: set bearer token value to a string when parameter is not keyed
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbrdn committed Dec 13, 2024
1 parent ad7ba80 commit a4105da
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/app/cli/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,12 @@ func RepoSetAuth(name, kind string, data []string) error {
confValues := parseNamedArgs(data)
err := assertNamedArgs(confValues, []string{"token"})
if err != nil {
var token string
if len(data) > 0 {
token = data[0]
}
rc[repos.KeyRepoAuth] = map[string]any{
repos.AuthMethodBearerToken: data,
repos.AuthMethodBearerToken: token,
}
} else {
rc[repos.KeyRepoAuth] = map[string]any{
Expand Down

0 comments on commit a4105da

Please sign in to comment.